From: WMDE-Fisch Date: Wed, 14 Aug 2019 17:07:39 +0000 (+0200) Subject: Use ExtensionRegistry instead of class name X-Git-Tag: 1.34.0-rc.0~713^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/Boston?a=commitdiff_plain;h=e1518660e17f9417c0b94dc821b22a08de6af35c;p=lhc%2Fweb%2Fwiklou.git Use ExtensionRegistry instead of class name Use the ExtensionRegistry instead of checking for the main class name of the Cite extension. - I'm not entirely sure if this is much better. A hook would still be the better option. But at least Cite could be refactored and the class name changed. Bug: T89151 Change-Id: I35e5aa9955141b575de68a5be2c0d5b87585eb77 --- diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index 25799420e8..8f0db447a1 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -74,8 +74,8 @@ class SearchHighlighter { 3 => "/(\n\\{\\|)|(\n\\|\\})/" ]; // table // @todo FIXME: This should prolly be a hook or something - // instead of hardcoding a class name from the Cite extension - if ( class_exists( 'Cite' ) ) { + // instead of hardcoding the name of the Cite extension + if ( \ExtensionRegistry::getInstance()->isLoaded( 'Cite' ) ) { $spat .= '|()'; // references via cite extension $endPatterns[4] = '/()|(<\/ref>)/'; }