r113211 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113210‎ | r113211 | r113212 >
Date:02:09, 7 March 2012
Author:catrope
Status:ok
Tags:
Comment:
It seems that parseMsg() sometimes receives strings, probably from bad dieUsageMsg() callers or badly formatter error arrays. I don't want to have to track this down, so I'm making it fail gracefully and just cast any strings to arrays
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiBase.php
@@ -1272,6 +1272,7 @@
12731273 * @return array('code' => code, 'info' => info)
12741274 */
12751275 public function parseMsg( $error ) {
 1276+ $error = (array)$error; // It seems strings sometimes make their way in here
12761277 $key = array_shift( $error );
12771278
12781279 // Check whether the error array was nested

Follow-up revisions

RevisionCommit summaryAuthorDate
r1132121.19wmf1: MFT r113211catrope02:10, 7 March 2012
r113235MFT r113171, r113195, r113211reedy15:14, 7 March 2012

Status & tagging log