Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -167,10 +167,14 @@ |
168 | 168 | protected function appendNamespaceAliases( $property ) { |
169 | 169 | global $wgNamespaceAliases, $wgContLang; |
170 | 170 | $wgContLang->load(); |
171 | | - $aliases = array_merge($wgNamespaceAliases, $wgContLang->namespaceAliases); |
172 | | - $aliases = array_diff_key($aliases, array_flip($wgContLang->getNamespaces())); |
| 171 | + $aliases = array_merge( $wgNamespaceAliases, $wgContLang->namespaceAliases ); |
| 172 | + $namespaces = $wgContLang->getNamespaces(); |
173 | 173 | $data = array(); |
174 | 174 | foreach( $aliases as $title => $ns ) { |
| 175 | + if( $namespaces[$ns] == $title ) { |
| 176 | + // Don't list duplicates |
| 177 | + continue; |
| 178 | + } |
175 | 179 | $item = array( |
176 | 180 | 'id' => $ns |
177 | 181 | ); |