From f04f07722ad4ba2cfdbc8ed369deabe7a1616996 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Wed, 8 Jun 2016 23:09:16 +0200 Subject: [PATCH] Respect $wgLinkTitlesParseOnEdit and $wgLinkTitlesParseOnRender. --- includes/LinkTitles_Extension.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/LinkTitles_Extension.php b/includes/LinkTitles_Extension.php index facec86..e0f26eb 100644 --- a/includes/LinkTitles_Extension.php +++ b/includes/LinkTitles_Extension.php @@ -61,6 +61,8 @@ class Extension { /// Event handler that is hooked to the PageContentSave event. public static function onPageContentSave( &$wikiPage, &$user, &$content, &$summary, $isMinor, $isWatch, $section, &$flags, &$status ) { + global $wgLinkTitlesParseOnEdit; + if (!$wgLinkTitlesParseOnEdit) return true; if ( !$isMinor && !\MagicWord::get('MAG_LINKTITLES_NOAUTOLINKS')->match( $text ) ) { $title = $wikiPage->getTitle(); @@ -77,6 +79,9 @@ class Extension { /// @param Parser $parser Parser that raised the event. /// @param $text Preprocessed text of the page. public static function onInternalParseBeforeLinks( \Parser &$parser, &$text ) { + global $wgLinkTitlesParseOnRender; + if (!$wgLinkTitlesParseOnRender) return true; + // If the page contains the magic word '__NOAUTOLINKS__', do not parse it. if ( !isset($parser->mDoubleUnderScores[$text] )) { $text = self::parseContent( $parser->getTitle(), $text );