It seems that parseMsg() sometimes receives strings, probably from bad dieUsageMsg...
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 7 Mar 2012 02:09:22 +0000 (02:09 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 7 Mar 2012 02:09:22 +0000 (02:09 +0000)
includes/api/ApiBase.php

index 461e2bc..bf197b3 100644 (file)
@@ -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