SearchHighlighter: Stop checking for existence of "wfCite" function
authorKunal Mehta <legoktm@gmail.com>
Thu, 30 Apr 2015 18:25:01 +0000 (11:25 -0700)
committerKunal Mehta <legoktm@gmail.com>
Thu, 30 Apr 2015 18:25:01 +0000 (11:25 -0700)
…and instead look for the Cite class. Not really any better, but
it will let us eliminate the "wfCite" global function.

Change-Id: Icdf82cb9771e6ae9bcaa6a02629b1b11f840a5c6

includes/search/SearchHighlighter.php

index 223a2fe..5087e8d 100644 (file)
@@ -58,7 +58,8 @@ class SearchHighlighter {
                        3 => "/(\n\\{\\|)|(\n\\|\\})/" ); // table
 
                // @todo FIXME: This should prolly be a hook or something
-               if ( function_exists( 'wfCite' ) ) {
+               // instead of hardcoding a class name from the Cite extension
+               if ( class_exists( 'Cite' ) ) {
                        $spat .= '|(<ref>)'; // references via cite extension
                        $endPatterns[4] = '/(<ref>)|(<\/ref>)/';
                }