]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Revert "Merge branch 'livesearch_patch' of https://github.com/blacktooth/Elgg"
authorSem <sembrestels@riseup.net>
Fri, 18 Nov 2011 06:24:23 +0000 (07:24 +0100)
committerSem <sembrestels@riseup.net>
Fri, 18 Nov 2011 06:24:23 +0000 (07:24 +0100)
This reverts commit 3939a817def8d0a3d047456c4ad3817d5ee0a1d5, reversing
changes made to 50aa0ce357fd307ac2623e96f22d7c0f973b22ff.

engine/lib/input.php

index 8ba3ac1807df9c45d05f350410bb88e486581e9a..56ec214dc6ff0dac97de6025a47dbbd4008935f6 100644 (file)
@@ -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;
 }