https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113541
Revision: 113541
Author: wikinaut
Date: 2012-03-09 23:13:40 +0000 (Fri, 09 Mar 2012)
Log Message:
-----------
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: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php
===================================================================
--- trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php 2012-03-09
22:59:13 UTC (rev 113540)
+++ trunk/extensions/WikiArticleFeeds/WikiArticleFeeds_body.php 2012-03-09
23:13:40 UTC (rev 113541)
@@ -2,13 +2,13 @@
class WikiArticleFeeds{
- function feedStart( $text, $params = array() ) {
- global $wgParser, $wgWikiArticleFeedsTrackingCategory;
+ function feedStart( $text, $params = array(), Parser $parser ) {
+ global $wgWikiArticleFeedsTrackingCategory;
if ( $wgWikiArticleFeedsTrackingCategory === true ) {
- $wgParser->addTrackingCategory(
'wikiarticlefeeds-tracking-category' );
+ $parser->addTrackingCategory(
'wikiarticlefeeds-tracking-category' );
} elseif ( is_string( $wgWikiArticleFeedsTrackingCategory ) ) {
- $wgParser->addTrackingCategory(
$wgWikiArticleFeedsTrackingCategory );
+ $parser->addTrackingCategory(
$wgWikiArticleFeedsTrackingCategory );
}
return '<!-- FEED_START -->';
}
@@ -25,13 +25,13 @@
return ( $text ? '<!-- ITEM_TAGS ' . base64_encode( serialize(
$text ) ) . ' -->':'' );
}
- function itemTagsFunction( $parser ) {
+ function itemTagsFunction( Parser $parser ) {
$tags = func_get_args();
array_shift( $tags );
return ( !empty( $tags ) ? '<pre>@ITEMTAGS@' . base64_encode(
serialize( implode( ',', $tags ) ) ) . '@ITEMTAGS@</pre>':'' );
}
- function itemTagsPlaceholderCorrections( $parser, &$text ) {
+ function itemTagsPlaceholderCorrections( Parser $parser, &$text ) {
$text = preg_replace(
'|<pre>@ITEMTAGS@([0-9a-zA-Z\\+\\/]+=*)@ITEMTAGS@</pre>|',
'<!-- ITEM_TAGS $1 -->',
@@ -41,7 +41,7 @@
}
# Sets up the WikiArticleFeeds Parser hooks
- static function wfWikiArticleFeedsSetup( $parser ) {
+ static function wfWikiArticleFeedsSetup( Parser $parser ) {
global $wgWikiArticleFeeds;
$parser->setHook( 'startFeed', array( $wgWikiArticleFeeds,
'feedStart' ) );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs