summaryrefslogtreecommitdiffstats
path: root/controller/itemcontroller.php
diff options
context:
space:
mode:
authorBernhard Posselt <Raydiation@users.noreply.github.com>2015-03-30 19:40:07 +0200
committerBernhard Posselt <Raydiation@users.noreply.github.com>2015-03-30 19:40:07 +0200
commit05985bc2965f8a332e98121050ba1f07343bbc0f (patch)
tree96ca5d59b7ce3c9d3678dd95d8595145d1d5df08 /controller/itemcontroller.php
parenteb7fc97f33cadcf041a06915b8f1650a9b4f6bbb (diff)
parentee3d2332ec97487893ae5f1f46b599c550b25eb6 (diff)
Merge pull request #751 from owncloud/next
Changes for 8.1
Diffstat (limited to 'controller/itemcontroller.php')
-rw-r--r--controller/itemcontroller.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php
index bf63bc0b8..7a500a88f 100644
--- a/controller/itemcontroller.php
+++ b/controller/itemcontroller.php
@@ -56,10 +56,11 @@ class ItemController extends Controller {
* @param int $offset
* @param bool $showAll
* @param bool $oldestFirst
+ * @param string $search
* @return array
*/
public function index($type, $id, $limit=50, $offset=0, $showAll=null,
- $oldestFirst=null) {
+ $oldestFirst=null, $search='') {
// in case this is called directly and not from the website use the
// internal state
@@ -82,6 +83,15 @@ class ItemController extends Controller {
$params = [];
+ // split search parameter on url space
+ $search = trim(urldecode($search));
+ $search = preg_replace('/\s+/', ' ', $search); // remove multiple ws
+ if ($search === '') {
+ $search = [];
+ } else {
+ $search = explode(' ', $search);
+ }
+
try {
// the offset is 0 if the user clicks on a new feed
@@ -97,7 +107,7 @@ class ItemController extends Controller {
$params['items'] = $this->itemService->findAll(
$id, $type, $limit, $offset, $showAll, $oldestFirst,
- $this->userId
+ $this->userId, $search
);
// this gets thrown if there are no items