https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113211
Revision: 113211
Author: catrope
Date: 2012-03-07 02:09:22 +0000 (Wed, 07 Mar 2012)
Log Message:
-----------
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: trunk/phase3/includes/api/ApiBase.php
===================================================================
--- trunk/phase3/includes/api/ApiBase.php 2012-03-07 02:05:47 UTC (rev
113210)
+++ trunk/phase3/includes/api/ApiBase.php 2012-03-07 02:09:22 UTC (rev
113211)
@@ -1272,6 +1272,7 @@
* @return array('code' => code, 'info' => info)
*/
public function parseMsg( $error ) {
+ $error = (array)$error; // It seems strings sometimes make
their way in here
$key = array_shift( $error );
// Check whether the error array was nested
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs