Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | |
106 | 106 | return ''; |
107 | 107 | } |
108 | | - |
| 108 | + |
109 | 109 | /** |
110 | 110 | * Parse blacklist from a string |
111 | 111 | * |
— | — | @@ -115,8 +115,7 @@ |
116 | 116 | wfProfileIn( __METHOD__ ); |
117 | 117 | $lines = preg_split( "/\r?\n/", $list ); |
118 | 118 | $result = array(); |
119 | | - foreach ( $lines as $line ) |
120 | | - { |
| 119 | + foreach ( $lines as $line ) { |
121 | 120 | $line = TitleBlacklistEntry :: newFromString( $line ); |
122 | 121 | if ( $line ) { |
123 | 122 | $result[] = $line; |
— | — | @@ -164,7 +163,7 @@ |
165 | 164 | if( $this->isWhitelisted( $title, $action ) ) { |
166 | 165 | return false; |
167 | 166 | } |
168 | | - return $item; |
| 167 | + return $item; // "returning true" |
169 | 168 | } |
170 | 169 | } |
171 | 170 | return false; |
— | — | @@ -254,8 +253,9 @@ |
255 | 254 | foreach( $blacklist as $e ) { |
256 | 255 | wfSuppressWarnings(); |
257 | 256 | $regex = $e->getRegex(); |
258 | | - if( preg_match( "/{$regex}/u", '' ) === false ) |
| 257 | + if( preg_match( "/{$regex}/u", '' ) === false ) { |
259 | 258 | $badEntries[] = $e->getRaw(); |
| 259 | + } |
260 | 260 | wfRestoreWarnings(); |
261 | 261 | } |
262 | 262 | return $badEntries; |
— | — | @@ -304,7 +304,8 @@ |
305 | 305 | * |
306 | 306 | * @param $title Title to check |
307 | 307 | * @param $action %Action to check |
308 | | - * @return TRUE if the user can; otherwise FALSE |
| 308 | + * @return TRUE if the the regex matches the title, and is not overridden |
| 309 | + * else if it doesn't match (or was overridden) |
309 | 310 | */ |
310 | 311 | public function matches( $title, $action ) { |
311 | 312 | wfSuppressWarnings(); |
— | — | @@ -314,24 +315,24 @@ |
315 | 316 | global $wgUser; |
316 | 317 | if( $match ) { |
317 | 318 | if( isset( $this->mParams['autoconfirmed'] ) && $wgUser->isAllowed( 'autoconfirmed' ) ) { |
318 | | - return true; |
| 319 | + return false; |
319 | 320 | } |
320 | 321 | if( isset( $this->mParams['moveonly'] ) && $action != 'move' ) { |
321 | | - return true; |
| 322 | + return false; |
322 | 323 | } |
323 | 324 | if( isset( $this->mParams['newaccountonly'] ) && $action != 'new-account' ) { |
324 | | - return true; |
| 325 | + return false; |
325 | 326 | } |
326 | 327 | if( !isset( $this->mParams['noedit'] ) && $action == 'edit' ) { |
327 | | - return true; |
| 328 | + return false; |
328 | 329 | } |
329 | 330 | if ( isset( $this->mParams['reupload'] ) && $action == 'upload' ) { |
330 | 331 | // Special:Upload also checks 'create' permissions when not reuploading |
331 | | - return true; |
| 332 | + return false; |
332 | 333 | } |
333 | | - return false; |
| 334 | + return true; |
334 | 335 | } |
335 | | - return true; |
| 336 | + return false; |
336 | 337 | } |
337 | 338 | |
338 | 339 | /** |