Index: trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php |
— | — | @@ -37,11 +37,11 @@ |
38 | 38 | |
39 | 39 | $detailsid = $wgRequest->getIntOrNull( 'details' ); |
40 | 40 | $hideid = $wgRequest->getIntOrNull( 'hide' ); |
41 | | - |
| 41 | + |
42 | 42 | if ( $parameter ) { |
43 | 43 | $detailsid = $parameter; |
44 | 44 | } |
45 | | - |
| 45 | + |
46 | 46 | if ( $detailsid ) { |
47 | 47 | $this->showDetails( $detailsid ); |
48 | 48 | } elseif ( $hideid ) { |
— | — | @@ -161,10 +161,10 @@ |
162 | 162 | array( 'afl_id' => $logid ), |
163 | 163 | __METHOD__ |
164 | 164 | ); |
165 | | - |
| 165 | + |
166 | 166 | $logPage = new LogPage( 'suppress' ); |
167 | 167 | $action = $fields['hidden'] ? 'hide-afl' : 'unhide-afl'; |
168 | | - |
| 168 | + |
169 | 169 | $logPage->addEntry( $action, $this->getTitle( $logid ), $fields['reason'] ); |
170 | 170 | |
171 | 171 | $wgOut->redirect( SpecialPage::getTitleFor( 'AbuseLog' )->getFullURL() ); |
— | — | @@ -202,8 +202,8 @@ |
203 | 203 | } |
204 | 204 | |
205 | 205 | $pager = new AbuseLogPager( $this, $conds ); |
206 | | - |
207 | | - if( $pager->getResult()->numRows() !== 0 ) { |
| 206 | + $result = $pager->getResult(); |
| 207 | + if( $result && $result->numRows() !== 0 ) { |
208 | 208 | $wgOut->addHTML( $pager->getNavigationBar() . |
209 | 209 | Xml::tags( 'ul', null, $pager->getBody() ) . |
210 | 210 | $pager->getNavigationBar() ); |
— | — | @@ -461,7 +461,7 @@ |
462 | 462 | |
463 | 463 | return $li ? Xml::tags( 'li', null, $description ) : $description; |
464 | 464 | } |
465 | | - |
| 465 | + |
466 | 466 | public static function getNotDeletedCond( $db ) { |
467 | 467 | $deletedZeroCond = $db->makeList( |
468 | 468 | array( 'afl_deleted' => 0 ), LIST_AND ); |
— | — | @@ -469,14 +469,23 @@ |
470 | 470 | array( 'afl_deleted' => null ), LIST_AND ); |
471 | 471 | $notDeletedCond = $db->makeList( |
472 | 472 | array( $deletedZeroCond, $deletedNullCond ), LIST_OR ); |
473 | | - |
| 473 | + |
474 | 474 | return $notDeletedCond; |
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
478 | 478 | class AbuseLogPager extends ReverseChronologicalPager { |
479 | | - public $mForm, $mConds; |
480 | 479 | |
| 480 | + /** |
| 481 | + * @var HtmlForm |
| 482 | + */ |
| 483 | + public $mForm; |
| 484 | + |
| 485 | + /** |
| 486 | + * @var array |
| 487 | + */ |
| 488 | + public $mConds; |
| 489 | + |
481 | 490 | function __construct( $form, $conds = array(), $details = false ) { |
482 | 491 | $this->mForm = $form; |
483 | 492 | $this->mConds = $conds; |