From e5008b99976808c373fb839ddae4c8543d1bc4b0 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Sun, 8 Jun 2014 22:52:36 +0200 Subject: [PATCH] Use ArticleAfterFetchContentObject hook. No longer use deprecated ArticleAfterFetchContent hook. The new hook requires MediaWiki 1.21 or later. --- LinkTitles.body.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/LinkTitles.body.php b/LinkTitles.body.php index cda5506..63b190a 100755 --- a/LinkTitles.body.php +++ b/LinkTitles.body.php @@ -38,7 +38,8 @@ $wgHooks['PageContentSave'][] = 'LinkTitles::onPageContentSave'; }; if ( $wgLinkTitlesParseOnRender ) { - $wgHooks['ArticleAfterFetchContent'][] = 'LinkTitles::onArticleAfterFetchContent'; + $wgHooks['ArticleAfterFetchContentObject'][] = + 'LinkTitles::onArticleAfterFetchContentObject'; }; $wgHooks['ParserBeforeTidy'][] = 'LinkTitles::removeMagicWord'; } @@ -56,9 +57,9 @@ /// Event handler that is hooked to the ArticleAfterFetchContent event. /// @param $article Article object /// @param $content Content object that holds the article content - public static function onArticleAfterFetchContent( &$article, &$content ) { - // The ArticleAfterFetchContent event is triggered whenever page content - // is retrieved from the database, i.e. also for editing etc. + public static function onArticleAfterFetchContentObject( &$article, &$content ) { + // The ArticleAfterFetchContentObject event is triggered whenever page + // content is retrieved from the database, i.e. also for editing etc. // Therefore we access the global $action variabl to only parse the // content when the page is viewed. global $action;