Index: trunk/extensions/CheckUser.php |
— | — | @@ -126,11 +126,20 @@ |
127 | 127 | function showLog() { |
128 | 128 | global $wgOut, $wgCheckUserLog; |
129 | 129 | $output = ''; |
130 | | - $log = array_reverse( file( $wgCheckUserLog ) ); |
131 | | - foreach( $log as $log_line ) { |
132 | | - $output .= $log_line; |
| 130 | + if( file_exists( $wgCheckUserLog ) ) { |
| 131 | + $log = file( $wgCheckUserLog ); |
| 132 | + if( !!$log ) { |
| 133 | + $log = array_reverse( $log ); |
| 134 | + foreach( $log as $log_line ) { |
| 135 | + $output .= $log_line; |
| 136 | + } |
| 137 | + $wgOut->addHTML( '<ul>' . $output . '</ul>' ); |
| 138 | + } else { |
| 139 | + $wgOut->addHTML( '<p>The CheckUser log could not be read.</p>' ); |
| 140 | + } |
| 141 | + } else { |
| 142 | + $wgOut->addHTML( '<p>The CheckUser log could not be found.</p>' ); |
133 | 143 | } |
134 | | - $wgOut->addHTML( '<ul>' . $output . '</ul>' ); |
135 | 144 | } |
136 | 145 | |
137 | 146 | function addLogEntry( $entry ) { |