-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
raymond@svn.wikimedia.org wrote:
$source = wfMsgForContent( 'captcha-addurl-whitelist' );
if( $source && $source != '<captcha-addurl-whitelist>' ) {
Consider using wfEmptyMsg() for these checks.
if ( $whitelist === false && $wgCaptchaWhitelist === false ) {
// $whitelist is empty, $wgCaptchaWhitelist is default
return true;
} elseif ( $whitelist === false && $wgCaptchaWhitelist !== false ) {
// $whitelist is empty
return !( preg_match( $wgCaptchaWhitelist, $url ) );
} else {
return !( preg_match( $wgCaptchaWhitelist, $url ) || preg_match( $whitelist, $url ) );
This seems a bit roundabout... it may be clearer to just check each regex in turn if it's set, then return true if it doesn't match any of the filters.
$regexes .= $regexStart .
str_replace( '/', '\/', preg_replace('|\\\*/|', '/', $build) ) .
Use preg_quote() for these rather than str_replace(); it'll be clearer.
- -- brion vibber (brion @ wikimedia.org)