X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fsearch%2FSearchHighlighter.php;h=dd41a6e1e4e0fe2e438b0891acad6538c7586b13;hp=2bd19558a229fd98170268fb89f00aad90335ca4;hb=9964ca1a390c446397dcd466916ffed356cdc3c9;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index 2bd19558a2..dd41a6e1e4 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -34,10 +34,11 @@ class SearchHighlighter { } /** - * Default implementation of wikitext highlighting + * Wikitext highlighting when $wgAdvancedSearchHighlighting = true * * @param string $text - * @param array $terms Terms to highlight (unescaped) + * @param array $terms Terms to highlight (not html escaped but + * regex escaped via SearchDatabase::regexTerm()) * @param int $contextlines * @param int $contextchars * @return string @@ -145,7 +146,6 @@ class SearchHighlighter { } $anyterm = implode( '|', $terms ); $phrase = implode( "$wgSearchHighlightBoundaries+", $terms ); - // @todo FIXME: A hack to scale contextchars, a correct solution // would be to have contextchars actually be char and not byte // length, and do proper utf-8 substrings and lengths everywhere, @@ -485,8 +485,10 @@ class SearchHighlighter { * Simple & fast snippet extraction, but gives completely unrelevant * snippets * + * Used when $wgAdvancedSearchHighlighting is false. + * * @param string $text - * @param array $terms + * @param array $terms Escaped for regex by SearchDatabase::regexTerm() * @param int $contextlines * @param int $contextchars * @return string