From e1518660e17f9417c0b94dc821b22a08de6af35c Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Wed, 14 Aug 2019 19:07:39 +0200 Subject: [PATCH] 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 --- includes/search/SearchHighlighter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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>)/'; } -- 2.20.1