Index: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -150,7 +150,9 @@ |
151 | 151 | |
152 | 152 | $parts = explode( '-', $code ); |
153 | 153 | $suffix = ''; |
154 | | - switch ( @$parts[1] ) { |
| 154 | + |
| 155 | + $parts1 = isset( $parts[1] ) ? $parts[1] : ''; |
| 156 | + switch ( $parts1 ) { |
155 | 157 | case 'latn': |
156 | 158 | $suffix = ' (Latin)'; # TODO: i18n |
157 | 159 | unset( $parts[1] ); |
— | — | @@ -196,7 +198,7 @@ |
197 | 199 | # $normkey = self::normaliseKey( $namespace, $key ); |
198 | 200 | $normkey = str_replace( " ", "_", strtolower( "$namespace:$key" ) ); |
199 | 201 | |
200 | | - $group = @self::$mi[$normkey]; |
| 202 | + $group = isset( self::$mi[$normkey] ) ? self::$mi[$normkey] : null; |
201 | 203 | if ( is_array( $group ) ) { |
202 | 204 | $group = $group[0]; |
203 | 205 | } |
— | — | @@ -213,7 +215,11 @@ |
214 | 216 | # $normkey = self::normaliseKey( $namespace, $key ); |
215 | 217 | $normkey = str_replace( " ", "_", strtolower( "$namespace:$key" ) ); |
216 | 218 | |
217 | | - return (array) @self::$mi[$normkey]; |
| 219 | + if( isset( self::$mi[$normkey] ) ) { |
| 220 | + return (array) self::$mi[$normkey]; |
| 221 | + } else { |
| 222 | + return array(); |
| 223 | + } |
218 | 224 | } |
219 | 225 | |
220 | 226 | public static function normaliseKey( $namespace, $key ) { |