r113541 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113540‎ | r113541 | r113542 >
Date:23:13, 9 March 2012
Author:wikinaut
Status:new
Tags:
Comment:
follow up rr113517 . Using the parser as passed as parameter appears to be a must do. thanks to everyone who help, I overlooked that. Please bear with me - that extension was not written initiall by me.
Modified paths:
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php
@@ -2,13 +2,13 @@
33
44 class WikiArticleFeeds{
55
6 - function feedStart( $text, $params = array() ) {
7 - global $wgParser, $wgWikiArticleFeedsTrackingCategory;
 6+ function feedStart( $text, $params = array(), Parser $parser ) {
 7+ global $wgWikiArticleFeedsTrackingCategory;
88
99 if ( $wgWikiArticleFeedsTrackingCategory === true ) {
10 - $wgParser->addTrackingCategory( 'wikiarticlefeeds-tracking-category' );
 10+ $parser->addTrackingCategory( 'wikiarticlefeeds-tracking-category' );
1111 } elseif ( is_string( $wgWikiArticleFeedsTrackingCategory ) ) {
12 - $wgParser->addTrackingCategory( $wgWikiArticleFeedsTrackingCategory );
 12+ $parser->addTrackingCategory( $wgWikiArticleFeedsTrackingCategory );
1313 }
1414 return '<!-- FEED_START -->';
1515 }
@@ -25,13 +25,13 @@
2626 return ( $text ? '<!-- ITEM_TAGS ' . base64_encode( serialize( $text ) ) . ' -->':'' );
2727 }
2828
29 - function itemTagsFunction( $parser ) {
 29+ function itemTagsFunction( Parser $parser ) {
3030 $tags = func_get_args();
3131 array_shift( $tags );
3232 return ( !empty( $tags ) ? '<pre>@ITEMTAGS@' . base64_encode( serialize( implode( ',', $tags ) ) ) . '@ITEMTAGS@</pre>':'' );
3333 }
3434
35 - function itemTagsPlaceholderCorrections( $parser, &$text ) {
 35+ function itemTagsPlaceholderCorrections( Parser $parser, &$text ) {
3636 $text = preg_replace(
3737 '|<pre>@ITEMTAGS@([0-9a-zA-Z\\+\\/]+=*)@ITEMTAGS@</pre>|',
3838 '<!-- ITEM_TAGS $1 -->',
@@ -41,7 +41,7 @@
4242 }
4343
4444 # Sets up the WikiArticleFeeds Parser hooks
45 - static function wfWikiArticleFeedsSetup( $parser ) {
 45+ static function wfWikiArticleFeedsSetup( Parser $parser ) {
4646 global $wgWikiArticleFeeds;
4747
4848 $parser->setHook( 'startFeed', array( $wgWikiArticleFeeds, 'feedStart' ) );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113517add tracking category feature (enabled by default). Each page using this exte...wikinaut20:10, 9 March 2012

Status & tagging log