SpecialLog: Don't ignore offender when it's a nonexistent username
[lhc/web/wiklou.git] / includes / specials / SpecialLog.php
index 195d08b..de3fd19 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Implements Special:Log
  *
- * Copyright © 2008 Aaron Schulz
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -81,10 +79,12 @@ class SpecialLog extends SpecialPage {
                $qc = [];
                if ( $opts->getValue( 'type' ) == 'suppress' ) {
                        $offender = User::newFromName( $opts->getValue( 'offender' ), false );
-                       if ( $offender && $offender->getId() > 0 ) {
-                               $qc = [ 'ls_field' => 'target_author_id', 'ls_value' => $offender->getId() ];
-                       } elseif ( $offender && IP::isIPAddress( $offender->getName() ) ) {
-                               $qc = [ 'ls_field' => 'target_author_ip', 'ls_value' => $offender->getName() ];
+                       if ( $offender ) {
+                               if ( $offender->getId() > 0 ) {
+                                       $qc = [ 'ls_field' => 'target_author_id', 'ls_value' => $offender->getId() ];
+                               } else {
+                                       $qc = [ 'ls_field' => 'target_author_ip', 'ls_value' => $offender->getName() ];
+                               }
                        }
                } else {
                        // Allow extensions to add relations to their search types
@@ -167,7 +167,7 @@ class SpecialLog extends SpecialPage {
                # Create a LogPager item to get the results and a LogEventsList item to format them...
                $loglist = new LogEventsList(
                        $this->getContext(),
-                       null,
+                       $this->getLinkRenderer(),
                        LogEventsList::USE_CHECKBOXES
                );