r4231 bugfix for recent change: custom search result were broken by the commit #4223
authorAlexey Andriyanov <alan@al-an.info>
Tue, 15 Feb 2011 13:20:49 +0000 (13:20 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Tue, 15 Feb 2011 13:20:49 +0000 (13:20 +0000)
renderSearchResults: added check if an argument is an array

wwwroot/inc/interface.php

index cba874082faa7c3481330eacfd0002cae3f169cd..0b5ad0e6a38894da580cab4761e18eef0f7df7f7 100644 (file)
@@ -3780,8 +3780,12 @@ function renderSearchResults ($terms, $summary)
                echo "<center><h2>Nothing found for '${terms}'</h2></center>";
        elseif ($nhits == 1)
        {
-               foreach ($summary as $realm => $container)
-                       $record = array_shift ($container);
+               foreach ($summary as $realm => $record)
+               {
+                       if (is_array ($record))
+                               $record = array_shift ($record);
+                       break;
+               }
                switch ($realm)
                {
                        case 'ipv4addressbydq':