aboutsummaryrefslogtreecommitdiffstats
path: root/search/ajax/search.php
diff options
context:
space:
mode:
Diffstat (limited to 'search/ajax/search.php')
-rw-r--r--search/ajax/search.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/search/ajax/search.php b/search/ajax/search.php
index 84a5a760cad..21e127e72b1 100644
--- a/search/ajax/search.php
+++ b/search/ajax/search.php
@@ -22,12 +22,24 @@
*/
// Check if we are a user
-OC_JSON::checkLoggedIn();
+\OC_JSON::checkLoggedIn();
\OC::$server->getSession()->close();
-$query=(isset($_GET['query']))?$_GET['query']:'';
+if (isset($_GET['query'])) {
+ $query = $_GET['query'];
+} else {
+ $query = '';
+}
+if (isset($_GET['inApps'])) {
+ $inApps = $_GET['inApps'];
+ if (is_string($inApps)) {
+ $inApps = array($inApps);
+ }
+} else {
+ $inApps = array();
+}
if($query) {
- $result = \OC::$server->getSearch()->search($query);
+ $result = \OC::$server->getSearch()->search($query, $inApps);
OC_JSON::encodedPrint($result);
}
else {