Skip to content
Snippets Groups Projects
Commit d11b409a authored by Demian Katz's avatar Demian Katz
Browse files

Simplified AJAX autocomplete method; moved array_values() into factory for...

Simplified AJAX autocomplete method; moved array_values() into factory for more consistent central behavior (this may not be necessary, but retaining it as a safety mechanism to prevent badly encoded output caused by associative arrays).
parent 78e2340b
No related merge requests found
...@@ -124,6 +124,6 @@ class Factory ...@@ -124,6 +124,6 @@ class Factory
} }
return (isset($handler) && is_object($handler)) return (isset($handler) && is_object($handler))
? $handler->getSuggestions($query) : array(); ? array_values($handler->getSuggestions($query)) : array();
} }
} }
...@@ -912,13 +912,9 @@ class AjaxController extends AbstractBase ...@@ -912,13 +912,9 @@ class AjaxController extends AbstractBase
*/ */
public function getACSuggestions() public function getACSuggestions()
{ {
$query = $this->getRequest()->getQuery();
return $this->output( return $this->output(
array_values( \VuFind\Autocomplete\Factory::getSuggestions($query), self::STATUS_OK
\VuFind\Autocomplete\Factory::getSuggestions(
$this->getRequest()->getQuery()
)
),
self::STATUS_OK
); );
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment