From d64516f5d992bb47a765949743506d8433a07d55 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 22 Jan 2011 23:01:56 +0100 Subject: Indexer v3 Rewrite: fix obvious typos and type errors --- inc/indexer.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'inc/indexer.php') diff --git a/inc/indexer.php b/inc/indexer.php index a61f3772a..087113587 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -277,7 +277,7 @@ class Doku_Indexer { else unset($val_idx[$id]); } $val_idx = array_keys($val_idx); - $this->_saveIndexKey($metaname.'_p', '', $pid, $val_idx); + $this->_saveIndexKey($metaname.'_p', '', $pid, implode(':', $val_idx)); } unset($metaidx); unset($metawords); @@ -559,8 +559,8 @@ class Doku_Indexer { private function _getIndex($idx, $suffix) { global $conf; $fn = $conf['indexdir'].'/'.$idx.$suffix.'.idx'; - if (!@file_exists($fn, FILE_IGNORE_NEW_LINES)) return array(); - return file($fn); + if (!@file_exists($fn)) return array(); + return file($fn, FILE_IGNORE_NEW_LINES); } /** @@ -773,7 +773,7 @@ class Doku_Indexer { $newLine = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $newLine); $newLine = trim($newLine, ':'); if ($count) { - if ($strlen($newLine) > 0) + if (strlen($newLine) > 0) return "$id*$count:".$newLine; else return "$id*$count".$newLine; @@ -794,7 +794,7 @@ class Doku_Indexer { foreach ($parts as $tuple) { if ($tuple == '') continue; list($key, $cnt) = explode('*', $tuple); - if (!$cnd) continue; + if (!$cnt) continue; $key = $keys[$key]; if (!$key) continue; $result[$key] = $cnt; -- cgit v1.2.3