From dcd7bbef2a24d76ea48a9acd958ec320b9abc989 Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 12 Apr 2013 19:57:51 +0000 Subject: fix quick search php warnings in some very rare cases git-svn-id: http://piwigo.org/svn/trunk@22175 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_search.inc.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/functions_search.inc.php') diff --git a/include/functions_search.inc.php b/include/functions_search.inc.php index 66be23bb4..6494f0d61 100644 --- a/include/functions_search.inc.php +++ b/include/functions_search.inc.php @@ -372,12 +372,12 @@ function analyse_qsearch($q, &$qtokens, &$qtoken_modifiers) $qtoken_modifiers = array(); for ($i=0; $i$rank ) + foreach ($allowed_images as $id=> &$rank ) { $weight = isset($by_weights[$id]) ? $by_weights[$id] : 1; $weight -= $rank/$divisor; - $allowed_images[$id] = $weight; + $rank = $weight; } + unset($rank); + arsort($allowed_images, SORT_NUMERIC); $search_results['items'] = array_keys($allowed_images); return $search_results; -- cgit v1.2.3