aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/input.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/input.php')
-rw-r--r--engine/lib/input.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/engine/lib/input.php b/engine/lib/input.php
index 8ba3ac180..56ec214dc 100644
--- a/engine/lib/input.php
+++ b/engine/lib/input.php
@@ -294,15 +294,15 @@ function input_livesearch_page_handler($page) {
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
- $result = array(
+ $json = json_encode(array(
'type' => 'user',
'name' => $entity->name,
'desc' => $entity->username,
'icon' => '<img class="livesearch_icon" src="' .
get_entity($entity->guid)->getIconURL('tiny') . '" />',
'guid' => $entity->guid
- );
- $results[$entity->name . rand(1, 100)] = $result;
+ ));
+ $results[$entity->name . rand(1, 100)] = $json;
}
}
break;
@@ -321,16 +321,16 @@ function input_livesearch_page_handler($page) {
";
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
- $result = array(
+ $json = json_encode(array(
'type' => 'group',
'name' => $entity->name,
'desc' => strip_tags($entity->description),
'icon' => '<img class="livesearch_icon" src="'
. get_entity($entity->guid)->getIcon('tiny') . '" />',
'guid' => $entity->guid
- );
+ ));
- $results[$entity->name . rand(1, 100)] = $result;
+ $results[$entity->name . rand(1, 100)] = $json;
}
}
break;
@@ -353,15 +353,15 @@ function input_livesearch_page_handler($page) {
if ($entities = get_data($query)) {
foreach ($entities as $entity) {
- $result = array(
+ $json = json_encode(array(
'type' => 'user',
'name' => $entity->name,
'desc' => $entity->username,
'icon' => '<img class="livesearch_icon" src="'
. get_entity($entity->guid)->getIcon('tiny') . '" />',
'guid' => $entity->guid
- );
- $results[$entity->name . rand(1, 100)] = $result;
+ ));
+ $results[$entity->name . rand(1, 100)] = $json;
}
}
break;
@@ -376,7 +376,7 @@ function input_livesearch_page_handler($page) {
}
ksort($results);
- echo json_encode(array_values($results));
+ echo implode($results, "\n");
exit;
}