Index: trunk/extensions/ConfirmEdit/ConfirmEdit.php |
— | — | @@ -486,22 +486,16 @@ |
487 | 487 | */ |
488 | 488 | function filterLink( $url ) { |
489 | 489 | global $wgCaptchaWhitelist; |
490 | | - $whitelist = false; |
491 | 490 | $source = wfMsgForContent( 'captcha-addurl-whitelist' ); |
492 | 491 | |
493 | | - if( $source && $source != '<captcha-addurl-whitelist>' ) { |
494 | | - $whitelist = $this->buildRegexes( explode( "\n", $source ) ); |
495 | | - } |
| 492 | + $whitelist = wfEmptyMsg( 'captcha-addurl-whitelist', $source ) |
| 493 | + ? false |
| 494 | + : $this->buildRegexes( explode( "\n", $source ) ); |
496 | 495 | |
497 | | - if ( $whitelist === false && $wgCaptchaWhitelist === false ) { |
498 | | - // $whitelist is empty, $wgCaptchaWhitelist is default |
499 | | - return true; |
500 | | - } elseif ( $whitelist === false && $wgCaptchaWhitelist !== false ) { |
501 | | - // $whitelist is empty |
502 | | - return !( preg_match( $wgCaptchaWhitelist, $url ) ); |
503 | | - } else { |
504 | | - return !( preg_match( $wgCaptchaWhitelist, $url ) || preg_match( $whitelist, $url ) ); |
505 | | - } |
| 496 | + $cwl = $wgCaptchaWhitelist !== false ? preg_match( $wgCaptchaWhitelist, $url ) : false; |
| 497 | + $wl = $whitelist !== false ? preg_match( $whitelist, $url ) : false; |
| 498 | + |
| 499 | + return !( $cwl || $wl ); |
506 | 500 | } |
507 | 501 | |
508 | 502 | /** |