r80438 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80437‎ | r80438 | r80439 >
Date:08:04, 17 January 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Use wfMessage() instead of playing with $wgMessageCache
Modified paths:
  • /trunk/extensions/Cite/Cite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/Cite_body.php
@@ -942,12 +942,11 @@
943943 * arbitrary number of tokens separated by [\t\n ]
944944 */
945945 function genLinkLabels($group, $message) {
946 - global $wgMessageCache;
947 -
948946 wfProfileIn( __METHOD__ );
949947 $text = false;
950 - if (is_object($wgMessageCache))
951 - $text = $wgMessageCache->get( $message, true, false );
 948+ $msg = wfMessage( $message )->inContentLanguage();
 949+ if ( $msg->exists() )
 950+ $text = $msg->plain();
952951 $this->mLinkLabels[$group] = ($text == '') ? false : preg_split( '#[\n\t ]#', $text );
953952 wfProfileOut( __METHOD__ );
954953 }

Comments

#Comment by Nikerabbit (talk | contribs)   13:02, 17 January 2011

Should the check

($text == '')

be changed to

strval( $text ) === ''

or somesuch?

Status & tagging log