Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -1119,6 +1119,14 @@ |
1120 | 1120 | */ |
1121 | 1121 | public function parseMsg( $error ) { |
1122 | 1122 | $key = array_shift( $error ); |
| 1123 | + |
| 1124 | + // Check whether the error array was nested |
| 1125 | + // array( array( <code>, <params> ), array( <another_code>, <params> ) ) |
| 1126 | + if( is_array( $key ) ){ |
| 1127 | + $error = $key; |
| 1128 | + $key = array_shift( $error ); |
| 1129 | + } |
| 1130 | + |
1123 | 1131 | if ( isset( self::$messageMap[$key] ) ) { |
1124 | 1132 | return array( 'code' => |
1125 | 1133 | wfMsgReplaceArgs( self::$messageMap[$key]['code'], $error ), |
— | — | @@ -1126,6 +1134,7 @@ |
1127 | 1135 | wfMsgReplaceArgs( self::$messageMap[$key]['info'], $error ) |
1128 | 1136 | ); |
1129 | 1137 | } |
| 1138 | + |
1130 | 1139 | // If the key isn't present, throw an "unknown error" |
1131 | 1140 | return $this->parseMsg( array( 'unknownerror', $key ) ); |
1132 | 1141 | } |