diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/fulltext.php | 1 | ||||
-rw-r--r-- | inc/indexer.php | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index be3938cac..0f2414213 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -304,6 +304,7 @@ function ft_pagesorter($a, $b){ */ function ft_snippet($id,$highlight){ $text = rawWiki($id); + $text = str_replace("\xC2\xAD",'',$text); // remove soft-hyphens $evdata = array( 'id' => $id, 'text' => &$text, diff --git a/inc/indexer.php b/inc/indexer.php index 9cf079261..526c8db05 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -221,7 +221,14 @@ function idx_getPageWords($page){ list($page,$body) = $data; - $body = strtr($body, "\r\n\t", ' '); + $body = strtr($body, + array( + "\r" => ' ', + "\n" => ' ', + "\t" => ' ', + "\xC2\xAD" => '', //soft-hyphen + ) + ); $tokens = explode(' ', $body); $tokens = array_count_values($tokens); // count the frequency of each token |