diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-09-21 21:51:18 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-09-21 21:51:18 +0200 |
commit | 3cbaa9a4ac8aae40957eda92e4cf6885524c183a (patch) | |
tree | df7e3dc1e2c8f7e3301d88a3c54204ccec51f0e3 | |
parent | 993efcf6a9ea92bcea4e4964ea0225aa164a73d6 (diff) | |
download | rpg-3cbaa9a4ac8aae40957eda92e4cf6885524c183a.tar.gz rpg-3cbaa9a4ac8aae40957eda92e4cf6885524c183a.tar.bz2 |
backlinkfix for pages with special characters #548
darcs-hash:20050921195118-7ad00-9070166cbaa26e3f27f7b92382346a70f5c479a1.gz
-rw-r--r-- | inc/fulltext.php | 9 | ||||
-rw-r--r-- | inc/indexer.php | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index 3940bc0c4..22e28845c 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -97,14 +97,15 @@ function ft_backlinks($id){ // quick lookup of the pagename $page = noNS($id); - $matches = idx_lookup(array($page)); + $sw = array(); // we don't use stopwords here + $matches = idx_lookup(idx_tokenizer($page,$sw)); //pagename may contain specials (_ or .) + $docs = ft_resultCombine(array_values($matches)); - if(!count($matches)) return $result; + if(!count($docs)) return $result; require_once(DOKU_INC.'inc/parserutils.php'); - // check instructions for matching links - foreach(array_keys($matches[$page]) as $match){ + foreach(array_keys($docs) as $match){ $instructions = p_cached_instructions(wikiFN($match),true); if(is_null($instructions)) continue; diff --git a/inc/indexer.php b/inc/indexer.php index fe8e74bd9..6ece84d7b 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -316,7 +316,7 @@ function idx_tokenizer($string,&$stopwords){ foreach ($arr as $w) { if (!is_numeric($w) && strlen($w) < 3) continue; $w = utf8_strtolower($w); - if(is_int(array_search("$w\n",$stopwords))) continue; + if($stopwords && is_int(array_search("$w\n",$stopwords))) continue; $words[] = $w; } }else{ |