From: Roan Kattouw Date: Wed, 7 Mar 2012 02:09:22 +0000 (+0000) Subject: It seems that parseMsg() sometimes receives strings, probably from bad dieUsageMsg... X-Git-Tag: 1.31.0-rc.0~24354 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=14b9e780c24848ce5799cf2936a0abcd44dedf5d;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 461e2bc333..bf197b32e4 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1272,6 +1272,7 @@ abstract class ApiBase extends ContextSource { * @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