r83673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83672‎ | r83673 | r83674 >
Date:21:39, 10 March 2011
Author:ialex
Status:resolved (Comments)
Tags:
Comment:
Per Jarry1250 on IRC: fix for r81469: accept StubObject in Message::inLanguage(); was breaking api.php?action=query&meta=allmessages
Modified paths:
  • /trunk/phase3/includes/Message.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Message.php
@@ -206,7 +206,7 @@
207207 * @return Message: $this
208208 */
209209 public function inLanguage( $lang ) {
210 - if( $lang instanceof Language ){
 210+ if( $lang instanceof Language || $lang instanceof StubObject ){
211211 $this->language = $lang;
212212 } elseif ( is_string( $lang ) ) {
213213 if( $this->language->getCode() != $lang ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r84321Per Hashar, fix for r83673: only accept StubContLang and StubUserLang for stu...ialex12:53, 19 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81469* Use wfMessage() instead of wfMsgGetKey()...ialex17:30, 3 February 2011

Comments

#Comment by Hashar (talk | contribs)   02:10, 18 March 2011

This also mean we can pass it any object! Maybe you could check if it is an instance of a StubContLang or StubUserLang instead.

#Comment by IAlex (talk | contribs)   12:54, 19 March 2011

Done in r84321.

Status & tagging log