Index: branches/querypage-work2/phase3/includes/Namespace.php |
— | — | @@ -240,22 +240,18 @@ |
241 | 241 | |
242 | 242 | /** |
243 | 243 | * Get a list of all namespace indices which are considered to contain content |
244 | | - * |
245 | | - * If only one content namespace exists, returns that single index (Int) |
246 | | - * If multiple content namespaces exist, it returns an array of indices |
247 | | - * |
248 | | - * @return mixed |
| 244 | + * @return array of namespace indices |
249 | 245 | */ |
250 | 246 | public static function getContentNamespaces() { |
251 | 247 | global $wgContentNamespaces; |
252 | | - if( empty( $wgContentNamespaces ) ) |
| 248 | + if( !is_array( $wgContentNamespaces ) || $wgContentNamespaces === array() ) { |
253 | 249 | return NS_MAIN; |
254 | | - // always force NS_MAIN to be part of array (to match the algorithm used by isContent) |
255 | | - elseif ( !in_array( NS_MAIN, $wgContentNamespaces ) ) |
256 | | - return array( NS_MAIN ) + $wgContentNamespaces; |
257 | | - else |
| 250 | + } elseif ( !in_array( NS_MAIN, $wgContentNamespaces ) ) { |
| 251 | + // always force NS_MAIN to be part of array (to match the algorithm used by isContent) |
| 252 | + return array_merge( array( NS_MAIN ), $wgContentNamespaces ); |
| 253 | + } else { |
258 | 254 | return $wgContentNamespaces; |
259 | | - |
| 255 | + } |
260 | 256 | } |
261 | 257 | /** |
262 | 258 | * Is the namespace first-letter capitalized? |