summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2017-04-25 18:20:32 +0200
committerGeorg Ehrke <developer@georgehrke.com>2017-04-25 18:20:32 +0200
commitc76633bb8aabff7f160d1b5cd0b7f2a259d009a7 (patch)
tree5ab26ede6851538bda66d09915cd343e722f3f37 /apps/dav/lib
parentac3cc5211b4b3b5671afa2feefab15303270e25f (diff)
downloadnextcloud-server-c76633bb8aabff7f160d1b5cd0b7f2a259d009a7.tar.gz
nextcloud-server-c76633bb8aabff7f160d1b5cd0b7f2a259d009a7.zip
require at least one param or prop filter element
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php b/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php
index 2c92a41e16b..4d22f310c24 100644
--- a/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php
+++ b/apps/dav/lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php
@@ -143,7 +143,7 @@ class CalendarSearchReport implements XmlDeserializable {
throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}filter element is required for this request');
}
- $propsOrParamsDefined = (!empty($newProps['filters']['props']) || !empty($newProps['filters']));
+ $propsOrParamsDefined = (!empty($newProps['filters']['props']) || !empty($newProps['filters']['params']));
$noCompsDefined = empty($newProps['filters']['comps']);
if ($propsOrParamsDefined && $noCompsDefined) {
throw new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter given without any {' . SearchPlugin::NS_Nextcloud . '}comp-filter');
@@ -153,6 +153,10 @@ class CalendarSearchReport implements XmlDeserializable {
throw new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}search-term is required for this request');
}
+ if (empty($newProps['filters']['props']) && empty($newProps['filters']['params'])) {
+ throw new BadRequest('At least one{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter is required for this request');
+ }
+
$obj = new self();
foreach ($newProps as $key => $value) {