Index: trunk/phase3/includes/Title.php |
— | — | @@ -1645,7 +1645,12 @@ |
1646 | 1646 | $m = array(); |
1647 | 1647 | if ( preg_match( "/^(.+?)_*:_*(.*)$/S", $dbkey, $m ) ) { |
1648 | 1648 | $p = $m[1]; |
1649 | | - if ( $ns = $wgContLang->getNsIndex( $p )) { |
| 1649 | + $lowerNs = $wgContLang->lc( $p ); |
| 1650 | + if ( $ns = Namespace::getCanonicalIndex( $lowerNs ) ) { |
| 1651 | + # Canonical namespace |
| 1652 | + $dbkey = $m[2]; |
| 1653 | + $this->mNamespace = $ns; |
| 1654 | + } elseif ( $ns = $wgContLang->getNsIndex( $lowerNs )) { |
1650 | 1655 | # Ordinary namespace |
1651 | 1656 | $dbkey = $m[2]; |
1652 | 1657 | $this->mNamespace = $ns; |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -228,33 +228,15 @@ |
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | | - * Get a namespace key by value, case insensitive. |
233 | | - * Only matches namespace names for the current language, not the |
234 | | - * canonical ones defined in Namespace.php. |
| 232 | + * Get a namespace key by value, case insensetive. |
235 | 233 | * |
236 | 234 | * @param string $text |
237 | 235 | * @return mixed An integer if $text is a valid value otherwise false |
238 | 236 | */ |
239 | | - function getLocalNsIndex( $text ) { |
240 | | - $this->load(); |
241 | | - $lctext = $this->lc($text); |
242 | | - if( ( $ns = $this->mNamespaceIds[$lctext] ) !== null ) return $ns; |
243 | | - return false; |
244 | | - } |
245 | | - |
246 | | - /** |
247 | | - * Get a namespace key by value, case insensitive. Canonical namespace |
248 | | - * names override custom ones defined for the current language. |
249 | | - * |
250 | | - * @param string $text |
251 | | - * @return mixed An integer if $text is a valid value otherwise false |
252 | | - */ |
253 | 237 | function getNsIndex( $text ) { |
254 | 238 | $this->load(); |
255 | 239 | $lctext = $this->lc($text); |
256 | | - if( ( $ns = Namespace::getCanonicalIndex( $lctext ) ) !== null ) return $ns; |
257 | | - if( ( $ns = $this->mNamespaceIds[$lctext] ) !== null ) return $ns; |
258 | | - return false; |
| 240 | + return isset( $this->mNamespaceIds[$lctext] ) ? $this->mNamespaceIds[$lctext] : false; |
259 | 241 | } |
260 | 242 | |
261 | 243 | /** |