From 9c06b470657f4b17ad3d3942185ecf71ad5a6129 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Wed, 25 Apr 2007 21:23:43 +0000 Subject: [PATCH] 9697: Adding InternalParseBeforeLinks Parser Hook for Semantic MediaWiki (documentation updates), from Jim R. Wilson --- RELEASE-NOTES | 1 + docs/hooks.txt | 6 ++++++ includes/Parser.php | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a2f1db7143..88cc20121c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -124,6 +124,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN 500 characters * Predefined block reasons added to Special:Blockip * (bug 9196) Installer now check that zend.ze1_compatibility_mode is off +* (bug 9697) Introduce 'InternalParseBeforeLinks' hook; see docs/hooks.txt for more information == Bugfixes since 1.9 == diff --git a/docs/hooks.txt b/docs/hooks.txt index 2e10c6dbba..9f5d289f12 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -396,6 +396,12 @@ $title: Title object of page $url: string value as output (out parameter, can modify) $query: query options passed to Title::getFullURL() +'InternalParseBeforeLinks': during Parser's internalParse method before links but +after noinclude/includeonly/onlyinclude and other processing. +&$this: Parser object +&$text: string containing partially parsed text +&$this->mStripState: Parser's internal StripState object + 'LogPageValidTypes': action being logged. DEPRECATED: Use $wgLogTypes &$type: array of strings diff --git a/includes/Parser.php b/includes/Parser.php index 73c86d5659..f92c829661 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1003,7 +1003,7 @@ class Parser $text = Sanitizer::removeHTMLtags( $text, array( &$this, 'attributeStripCallback' ) ); $text = $this->replaceVariables( $text, $args ); - wfRunHooks( 'InternalParseBeforeLinks', array( &$this, &$text ) ); + wfRunHooks( 'InternalParseBeforeLinks', array( &$this, &$text, &$this->mStripState ) ); // Tables need to come after variable replacement for things to work // properly; putting them before other transformations should keep -- 2.20.1