{"record":{"id":"9fd339498617b19d","repo":"nextcloud/server","slug":"the-http-nextcloud-com-ns-prop-filter-requires","errorCode":null,"errorMessage":"The {http://nextcloud.com/ns}prop-filter requires a valid name attribute","messagePattern":"The (.+?)prop-filter requires a valid name attribute","errorType":"http","errorClass":"Sabre\\DAV\\Exception\\BadRequest","httpStatus":400,"severity":"error","filePath":"apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php","lineNumber":32,"sourceCode":"use Sabre\\Xml\\Reader;\nuse Sabre\\Xml\\XmlDeserializable;\n\nclass PropFilter implements XmlDeserializable {\n\n\t/**\n\t * @param Reader $reader\n\t * @throws BadRequest\n\t * @return string\n\t */\n\t#[\\Override]\n\tpublic static function xmlDeserialize(Reader $reader) {\n\t\t$att = $reader->parseAttributes();\n\t\t$componentName = $att['name'];\n\n\t\t$reader->parseInnerTree();\n\n\t\tif (!is_string($componentName)) {\n\t\t\tthrow new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}prop-filter requires a valid name attribute');\n\t\t}\n\n\t\treturn $componentName;\n\t}\n}\n","sourceCodeStart":14,"sourceCodeEnd":38,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/CalDAV/Search/Xml/Filter/PropFilter.php#L14-L38","documentation":"Thrown when a {http://nextcloud.com/ns}prop-filter element in a search REPORT has no name attribute: PropFilter::xmlDeserialize() reads $att['name'], and if it is not a string it rejects the request with Sabre\\DAV\\Exception\\BadRequest (HTTP 400). The name must be the iCal property to search, such as SUMMARY or ATTENDEE.","triggerScenarios":"Sending <n:prop-filter/> (empty) or a prop-filter whose attributes were serialized under a different local name, inside <n:comp-filter>.","commonSituations":"Dynamic filter builders emitting placeholder elements for unset fields; XML generated with the attribute namespace-bound incorrectly so parseAttributes() does not see it.","solutions":["Provide the property name: <n:prop-filter name=\"SUMMARY\"/>","Omit the element entirely when no property filter is wanted (note the report then requires at least one prop- or param-filter elsewhere)","Log the outgoing XML body during development to catch attribute-less elements"],"exampleFix":"// before\n<n:prop-filter/>\n\n// after\n<n:prop-filter name=\"SUMMARY\"/>","handlingStrategy":"validation","validationCode":"function buildPropFilter(string $name): string {\n    if (!is_string($name) || $name === '') {\n        throw new InvalidArgumentException('prop-filter requires name (e.g. SUMMARY)');\n    }\n    return \"<n:prop-filter name=\\\"{$name}\\\"/>\";\n}","typeGuard":"function isValidPropFilterName(mixed $name): bool {\n    return is_string($name) && $name !== ''\n        && preg_match('/^[A-Z0-9-]+$/', $name) === 1; // SUMMARY, ATTENDEE, ...\n}","tryCatchPattern":"try {\n    $client->request('REPORT', $calendarUri, $xmlBody);\n} catch (\\Sabre\\Http\\ClientException $e) {\n    if ($e->getResponse()?->getStatus() === 400) { /* add name=\"SUMMARY\" to prop-filter */ }\n}","preventionTips":["Maintain a whitelist of searchable properties (SUMMARY, DESCRIPTION, LOCATION, ATTENDEE, CATEGORIES)","Skip prop-filter emission when no property selected","Namespace-qualify attributes correctly so parseAttributes() finds them"],"tags":["caldav","xml","search","nextcloud","bad-request","prop-filter"],"backgroundTag":"webdav-400-bad-request","analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}