From 14b9e780c24848ce5799cf2936a0abcd44dedf5d Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 7 Mar 2012 02:09:22 +0000 Subject: [PATCH] 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 --- includes/api/ApiBase.php | 1 + 1 file changed, 1 insertion(+) 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 -- 2.20.1