diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-04 21:39:53 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-04 21:39:53 +0100 |
commit | 603c1a1e6dfa9f1bc6759843283a8a7995c613f8 (patch) | |
tree | 61349b0905bf69e2370f150d6e32901bad1aa25f /inc/fulltext.php | |
parent | b35d34217e073f330111fea5812fa4d88680a4ef (diff) | |
parent | 4b142187c1238555a14d79ff6e054a678ce828f3 (diff) | |
download | rpg-603c1a1e6dfa9f1bc6759843283a8a7995c613f8.tar.gz rpg-603c1a1e6dfa9f1bc6759843283a8a7995c613f8.tar.bz2 |
Merge remote-tracking branch 'origin/master' into FS#2124deniedtext
Conflicts:
inc/lang/bn/lang.php
inc/lang/fr/denied.txt
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r-- | inc/fulltext.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index 87b5a7370..dd918f214 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -72,8 +72,20 @@ function _ft_pageSearch(&$data) { $pages = end($stack); $pages_matched = array(); foreach(array_keys($pages) as $id){ - $text = utf8_strtolower(rawWiki($id)); - if (strpos($text, $phrase) !== false) { + $evdata = array( + 'id' => $id, + 'phrase' => $phrase, + 'text' => rawWiki($id) + ); + $evt = new Doku_Event('FULLTEXT_PHRASE_MATCH',$evdata); + if ($evt->advise_before() && $evt->result !== true) { + $text = utf8_strtolower($evdata['text']); + if (strpos($text, $phrase) !== false) { + $evt->result = true; + } + } + $evt->advise_after(); + if ($evt->result === true) { $pages_matched[$id] = 0; // phrase: always 0 hit } } |