Skip to content
Snippets Groups Projects

[Sprint/GiddyGiraffe] (fix): strip hash character from search

1 unresolved thread
4 files
+ 70
5
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -34,10 +34,12 @@ class suggest implements Interfaces\Api, Interfaces\ApiIgnorePam
@@ -34,10 +34,12 @@ class suggest implements Interfaces\Api, Interfaces\ApiIgnorePam
$limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 12;
$limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 12;
$hydrate = isset($_GET['hydrate']) && $_GET['hydrate'];
$hydrate = isset($_GET['hydrate']) && $_GET['hydrate'];
 
$query = str_replace('#', '', $_GET['q']);
 
// TODO: get strict taxonomy from pages[0] when multiple suggests are implemented
// TODO: get strict taxonomy from pages[0] when multiple suggests are implemented
try {
try {
$entities = $search->suggest('user', $_GET['q'], $limit);
$entities = $search->suggest('user', $query, $limit);
$entities = array_values(array_filter($entities, function ($entity) {
$entities = array_values(array_filter($entities, function ($entity) {
return isset($entity['guid']);
return isset($entity['guid']);
}));
}));
Loading