Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -316,25 +316,24 @@ |
317 | 317 | |
318 | 318 | # Namespace filtering |
319 | 319 | if( $opts['namespace'] !== '' ) { |
320 | | - $selectedNS = $dbr->addQuotes( $opts['namespace'] ); |
321 | | - $operator = $opts['invert'] ? '!=' : '='; |
322 | | - $boolean = $opts['invert'] ? 'AND' : 'OR'; |
| 320 | + $namespaces[] = $opts['namespace']; |
323 | 321 | |
324 | | - # namespace association (bug 2429) |
325 | | - if( !$opts['associated'] ) { |
326 | | - $condition = "rc_namespace $operator $selectedNS"; |
327 | | - } else { |
328 | | - # Also add the associated namespace |
329 | | - $associatedNS = $dbr->addQuotes( |
330 | | - MWNamespace::getAssociated( $opts['namespace'] ) |
331 | | - ); |
332 | | - $condition = "(rc_namespace $operator $selectedNS " |
333 | | - . $boolean |
334 | | - . " rc_namespace $operator $associatedNS)"; |
| 322 | + $inversionSuffix = $opts['invert'] ? '!' : ''; |
| 323 | + |
| 324 | + if( $opts['associated'] ) { |
| 325 | + # namespace association (bug 2429) |
| 326 | + $namespaces[] = MWNamespace::getAssociated( $opts['namespace'] ); |
335 | 327 | } |
336 | 328 | |
| 329 | + $condition = $dbr->makeList( |
| 330 | + array( 'rc_namespace' . $inversionSuffix |
| 331 | + => $namespaces ), |
| 332 | + LIST_AND |
| 333 | + ); |
| 334 | + |
337 | 335 | $conds[] = $condition; |
338 | 336 | } |
| 337 | + |
339 | 338 | return $conds; |
340 | 339 | } |
341 | 340 | |