From 2f62eba70f87d629498e5ed3b95e669bd383846a Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 25 May 2010 15:19:55 +0200 Subject: [PATCH] Fixes search token database reconstruction. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- bin/search.rebuild_db.php | 8 ++++---- classes/profile.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/search.rebuild_db.php b/bin/search.rebuild_db.php index cd7e56c..5e43d31 100755 --- a/bin/search.rebuild_db.php +++ b/bin/search.rebuild_db.php @@ -20,17 +20,17 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require('./connect.db.inc.php'); +require './connect.db.inc.php'; -ini_set('memory_limit', "16M"); +ini_set('memory_limit', '16M'); $globals->debug = 0; // Do not store backtraces $res = XDB::iterRow('SELECT pid FROM profiles'); $i = 0; $n = $res->total(); -while ($pid = $res->next()->fetchOneCell()) { - Profile::rebuildSearchTokens($pid); +while ($pid = $res->next()) { + Profile::rebuildSearchTokens(intval($pid[0])); printf("\r%u / %u", ++$i, $n); } diff --git a/classes/profile.php b/classes/profile.php index 53d9100..de46ff5 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -897,7 +897,7 @@ class Profile WHERE n.pid = {?}", $pid); - foreach ($keys as $i => $key) { + while ($key = $keys->next()) { if ($key['name'] == '') { continue; } -- 2.1.4