Index: trunk/extensions/AbuseFilter/SpecialAbuseLog.php |
— | — | @@ -459,6 +459,17 @@ |
460 | 460 | |
461 | 461 | return $li ? Xml::tags( 'li', null, $description ) : $description; |
462 | 462 | } |
| 463 | + |
| 464 | + public static function getNotDeletedCond( $db ) { |
| 465 | + $deletedZeroCond = $db->makeList( |
| 466 | + array( 'afl_deleted' => 0 ), LIST_AND ); |
| 467 | + $deletedNullCond = $db->makeList( |
| 468 | + array( 'afl_deleted' => null ), LIST_AND ); |
| 469 | + $notDeletedCond = $db->makeList( |
| 470 | + array( $deletedZeroCond, $deletedNullCond ), LIST_OR ); |
| 471 | + |
| 472 | + return $notDeletedCond; |
| 473 | + } |
463 | 474 | } |
464 | 475 | |
465 | 476 | class AbuseLogPager extends ReverseChronologicalPager { |
— | — | @@ -491,7 +502,8 @@ |
492 | 503 | ); |
493 | 504 | |
494 | 505 | if ( !$this->mForm->canSeeHidden() ) { |
495 | | - $info['conds']['afl_deleted'] = 0; |
| 506 | + $db = $this->mDb; |
| 507 | + $info['conds'][] = SpecialAbuseLog::getNotDeletedCond($db); |
496 | 508 | } |
497 | 509 | |
498 | 510 | return $info; |
Index: trunk/extensions/AbuseFilter/ApiQueryAbuseLog.php |
— | — | @@ -84,10 +84,13 @@ |
85 | 85 | $this->addOption( 'LIMIT', $params['limit'] + 1 ); |
86 | 86 | |
87 | 87 | $this->addWhereRange( 'afl_timestamp', $params['dir'], $params['start'], $params['end'] ); |
| 88 | + |
| 89 | + $db = $this->getDatabase(); |
| 90 | + $notDeletedCond = SpecialAbuseLog::getNotDeletedCondition($db); |
88 | 91 | |
89 | 92 | $this->addWhereIf( array( 'afl_user_text' => $params['user'] ), isset( $params['user'] ) ); |
90 | 93 | $this->addWhereIf( array( 'afl_filter' => $params['filter'] ), isset( $params['filter'] ) ); |
91 | | - $this->addWhereIf( array( 'afl_deleted' => 0 ), !SpecialAbuseLog::canSeeHidden() ); |
| 94 | + $this->addWhereIf( $notDeletedCond, !SpecialAbuseLog::canSeeHidden() ); |
92 | 95 | |
93 | 96 | $title = $params['title']; |
94 | 97 | if ( !is_null( $title ) ) { |