r95178 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95177‎ | r95178 | r95179 >
Date:20:22, 21 August 2011
Author:bawolff
Status:resolved (Comments)
Tags:
Comment:
(follow-up r91812) change to wfMessage per Roan's suggestion.

I did do some testing, and this appears to work in the edge case of message in user lang but not content.
Modified paths:
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
@@ -56,16 +56,17 @@
5757
5858 // Check to make sure that feed type is supported.
5959 if ( FeedUtils::checkFeedOutput( $params['feed'] ) ) {
60 -
61 - if ( !wfEmptyMsg( 'feed-' . $params['feed'] ) ) {
 60+ $msg = wfMessage( 'feed-' . $params['feed'] )->inContentLanguage();
 61+ if ( $msg->exists() ) {
6262 // This seems a little icky since
6363 // its re-using another message in a
6464 // different context.
6565 // uses feed-rss and feed-atom messages.
66 - $feedType = wfMsgForContent( 'feed-' . $params['feed'] );
 66+ $feedType = $msg->toString();
6767 } else {
6868 $feedType = $wgContLang->uc( $params['feed'] );
6969 }
 70+
7071 $feed = new $wgFeedClasses[ $params['feed'] ](
7172 wfMsgExt( 'googlenewssitemap_feedtitle',
7273 array( 'parsemag', 'content' ),

Sign-offs

UserFlagDate
Nikerabbitinspected06:38, 22 August 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r95342Follow-up r95178 - use ->text() instead of toString() on the message per Nike...bawolff22:05, 23 August 2011
r95628MFT to REL1_18 (extensions)...hashar15:32, 28 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91812(bug 29563 comment 11) Use feed-atom and feed-rss messages instead of RSS and...bawolff23:06, 9 July 2011

Comments

#Comment by Nikerabbit (talk | contribs)   06:38, 22 August 2011

Can you change toString() to text()? I doubt that you want implicit parsing of the contents here.

#Comment by Bawolff (talk | contribs)   20:58, 22 August 2011

Thanks. I'm still getting used to the newer wfMessage stuff. I'll change it once I have internet again (that doesn't block svn; stupid free wifi ;)

#Comment by Catrope (talk | contribs)   21:37, 22 August 2011

This can be marked resolved once Nikerabbit's concern is addressed.

Status & tagging log