Add command line tool to convert tombody notes to rST
[grauphel.git] / lib / search / provider.php
index 5b42bb70f9c6c6ce1e0b5864c7cf59d04cd999a6..b3957781cb2c6ec66654f0eb73d2b6a340a1f415 100644 (file)
@@ -40,13 +40,15 @@ class Provider extends \OCP\Search\Provider
         $urlGen = \OC::$server->getURLGenerator();
         $notes  = new NoteStorage($urlGen);
         $notes->setUsername(\OC_User::getUser());
-        $rows = $notes->search($query);
+
+        $qp = new QueryParser();
+        $rows = $notes->search($qp->parse($query));
 
         $results = array();
         foreach ($rows as $row) {
             $res = new Note();
             $res->id   = $row['note_guid'];
-            $res->name = $row['note_title'];
+            $res->name = htmlspecialchars_decode($row['note_title']);
             $res->link = $urlGen->linkToRoute(
                 'grauphel.gui.note', array('guid' => $row['note_guid'])
             );