From 3fc667cfbc05c58679586aeccdb47438798a8e15 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 13 Nov 2006 13:26:45 +0100 Subject: fixes for stricter php5 typing (bug#978) darcs-hash:20061113122645-9b6ab-e5f5be2e88eea7eb00643e6a5210086f46191c30.gz --- inc/indexer.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'inc/indexer.php') diff --git a/inc/indexer.php b/inc/indexer.php index c90f2b179..f7bc4a7c4 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -96,13 +96,15 @@ function idx_getPageWords($page){ if ($conf['deaccent']) { $links = p_get_metadata($page,'relation references'); - $tmp = join(' ',array_keys($links)); // make a single string - $tmp = strtr($tmp, ':', ' '); // replace namespace separator with a space - $link_tokens = array_unique(explode(' ', $tmp)); // break into tokens - - foreach ($link_tokens as $link_token) { - if (isset($tokens[$link_token])) continue; - $tokens[$link_token] = 1; + if (!empty($links)) { + $tmp = join(' ',array_keys($links)); // make a single string + $tmp = strtr($tmp, ':', ' '); // replace namespace separator with a space + $link_tokens = array_unique(explode(' ', $tmp)); // break into tokens + + foreach ($link_tokens as $link_token) { + if (isset($tokens[$link_token])) continue; + $tokens[$link_token] = 1; + } } } -- cgit v1.2.3