r53043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53042‎ | r53043 | r53044 >
Date:11:54, 10 July 2009
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Made wfMsg('') and wfMsg(null) silently return <> as it did before r52503. Thanks to those who supplied backtraces.
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MessageCache.php
@@ -501,10 +501,9 @@
502502 function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
503503 global $wgContLanguageCode, $wgContLang;
504504
505 - if ( !is_string( $key ) ) {
506 - throw new MWException( __METHOD__.': Invalid message key of type ' . gettype( $key ) );
507 - } elseif ( $key === '' ) {
508 - throw new MWException( __METHOD__.': Invaild message key: empty string' );
 505+ if ( strval( $key ) === '' ) {
 506+ # Shortcut: the empty key is always missing
 507+ return '<>';
509508 }
510509
511510 $lang = wfGetLangObj( $langcode );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52503* Introduced a new system for localisation caching. The system is based aroun...tstarling07:11, 28 June 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   19:35, 10 July 2009

Alright, those errors are gone now

Status & tagging log