r82361 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82360‎ | r82361 | r82362 >
Date:23:07, 17 February 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
1.17wmf1: Live hack to shut up "Non-string key given" exceptions for numeric keys that somehow become ints. This bug should also be fixed on trunk, I guess, possibly in a nicer way
Modified paths:
  • /branches/wmf/1.17wmf1/includes/MessageCache.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/MessageCache.php
@@ -504,6 +504,11 @@
505505 function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
506506 global $wgLanguageCode, $wgContLang;
507507
 508+ if ( is_int( $key ) ) {
 509+ // "Non-string key given" exception sometimes happens for numerical strings that become ints somewhere on their way here
 510+ $key = strval( $key );
 511+ }
 512+
508513 if ( !is_string( $key ) ) {
509514 throw new MWException( "Non-string key given" );
510515 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r97144Merge r82361 from 1.17wmf1 to trunk. This shuts up "Non-string key given" exc...catrope11:12, 15 September 2011
r97173Merged revisions 97087,97091-97092,97094,97096-97098,97100-97101,97103,97136,...dantman16:19, 15 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   08:02, 18 February 2011

I think you're just hiding actual bugs here. There must not be any numerical message keys, especially as an int since it would cause bugs with numbers starting with zero.

Status & tagging log