diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2016-01-26 13:04:41 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2016-01-26 13:04:41 +0100 |
commit | 8afa39682c2b637b35fd3722a5aa7e443878fb65 (patch) | |
tree | b3b85d3d891e6e6b6a896fbd329e028440de68a4 /apps | |
parent | 49c8f3d6e47f832c77b8b848da37d03e70715563 (diff) | |
download | nextcloud-server-8afa39682c2b637b35fd3722a5aa7e443878fb65.tar.gz nextcloud-server-8afa39682c2b637b35fd3722a5aa7e443878fb65.zip |
Revert "utilize elementMap for parsing DateTime string input argument for REPORT method"
This reverts commit 2027bf2686ee077fb2ad65f7a91f920c96b3fd85.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/comments/commentsplugin.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/dav/lib/comments/commentsplugin.php b/apps/dav/lib/comments/commentsplugin.php index 15f4aae3ae2..2f9b7bab59f 100644 --- a/apps/dav/lib/comments/commentsplugin.php +++ b/apps/dav/lib/comments/commentsplugin.php @@ -34,7 +34,6 @@ use Sabre\DAV\Xml\Element\Response; use Sabre\DAV\Xml\Response\MultiStatus; use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; -use Sabre\Xml\Reader; use Sabre\Xml\Writer; /** @@ -46,7 +45,7 @@ class CommentsPlugin extends ServerPlugin { const REPORT_PARAM_LIMIT = '{http://owncloud.org/ns}limit'; const REPORT_PARAM_OFFSET = '{http://owncloud.org/ns}offset'; - const REPORT_PARAM_DATETIME = '{http://owncloud.org/ns}datetime'; + const REPORT_PARAM_TIMESTAMP = '{http://owncloud.org/ns}datetime'; /** @var ICommentsManager */ protected $commentsManager; @@ -91,11 +90,6 @@ class CommentsPlugin extends ServerPlugin { $writer->write($value->format('Y-m-d H:m:i')); }; - $this->server->xml->elementMap[self::REPORT_PARAM_DATETIME] = function(Reader $reader) { - $element = $reader->parseInnerTree(); - return empty($element) ? null : new \DateTime($element); - }; - $this->server->on('report', [$this, 'onReport']); $this->server->on('method:POST', [$this, 'httpPost']); } @@ -149,7 +143,7 @@ class CommentsPlugin extends ServerPlugin { $acceptableParameters = [ $this::REPORT_PARAM_LIMIT, $this::REPORT_PARAM_OFFSET, - $this::REPORT_PARAM_DATETIME + $this::REPORT_PARAM_TIMESTAMP ]; $ns = '{' . $this::NS_OWNCLOUD . '}'; foreach($report as $parameter) { @@ -159,6 +153,10 @@ class CommentsPlugin extends ServerPlugin { $args[str_replace($ns, '', $parameter['name'])] = $parameter['value']; } + if(!is_null($args['datetime'])) { + $args['datetime'] = new \DateTime($args['datetime']); + } + $results = $node->findChildren($args['limit'], $args['offset'], $args['datetime']); $responses = []; |