From a480d98b3f2664d97004a5def88b06abd93039c5 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 28 Apr 2017 18:57:52 -0700 Subject: [PATCH] Fixup use of $ceAllowConfirmedEmail Follows-up 37f2dcf. confirmEditSetup() maps it to the new name so any use of it within the extension can safely be replaced. * Fix Catpcha.php. * Update README.md. Change-Id: I4b23954eba2d7d3e86e4f60d8189e263b864fbd3 --- README.md | 4 ++-- SimpleCaptcha/Captcha.php | 6 ++---- includes/ConfirmEditHooks.php | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2d2de4475..09d83c832 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The reCAPTCHA module was written by Mike Crawford and Ben Maurer. Additional maintenance work was done by Yaron Koren. -### Configuations Comments +### Configuration comments ```php /** * List of IP ranges to allow to skip the captcha, similar to the group setting: @@ -128,7 +128,7 @@ $wgCaptchaBadLoginExpiration = 5 * 60; * Allow users who have confirmed their email addresses to post * URL links without being harassed by the captcha. */ -$ceAllowConfirmedEmail = false; +$wgAllowConfirmedEmail = false; /** * Number of bad login attempts before triggering the captcha. 0 means the diff --git a/SimpleCaptcha/Captcha.php b/SimpleCaptcha/Captcha.php index c9489b01e..aaf9db2c0 100644 --- a/SimpleCaptcha/Captcha.php +++ b/SimpleCaptcha/Captcha.php @@ -487,9 +487,7 @@ class SimpleCaptcha { * @return bool true if the captcha should run */ function shouldCheck( WikiPage $page, $content, $section, $context, $oldtext = null ) { - // @codingStandardsIgnoreStart - global $ceAllowConfirmedEmail; - // @codingStandardsIgnoreEnd + global $wgAllowConfirmedEmail; if ( !$context instanceof IContextSource ) { $context = RequestContext::getMain(); @@ -505,7 +503,7 @@ class SimpleCaptcha { } elseif ( $this->isIPWhitelisted() ) { wfDebug( "ConfirmEdit: user IP is whitelisted" ); return false; - } elseif ( $ceAllowConfirmedEmail && $user->isEmailConfirmed() ) { + } elseif ( $wgAllowConfirmedEmail && $user->isEmailConfirmed() ) { wfDebug( "ConfirmEdit: user has confirmed mail, skipping captcha\n" ); return false; } diff --git a/includes/ConfirmEditHooks.php b/includes/ConfirmEditHooks.php index a77638b5a..94ec9bd00 100644 --- a/includes/ConfirmEditHooks.php +++ b/includes/ConfirmEditHooks.php @@ -28,7 +28,7 @@ class ConfirmEditHooks { /** * PageContentSaveComplete hook handler. - * Clear IP whitelist cache on page saves for [[MediaWiki:captcha-ip-whitelist]]. + * Clear IP whitelist cache on page saves for [[MediaWiki:Captcha-ip-whitelist]]. * * @param WikiPage $wikiPage * @param User $user @@ -88,8 +88,8 @@ class ConfirmEditHooks { */ public static function confirmEditSetup() { // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix - global $wgCaptchaTriggers, $wgWikimediaJenkinsCI, $ceAllowConfirmedEmail, - $wgAllowConfirmedEmail; + global $wgCaptchaTriggers, $wgAllowConfirmedEmail, + $wgWikimediaJenkinsCI, $ceAllowConfirmedEmail; // @codingStandardsIgnoreEnd // There is no need to run (core) tests with enabled ConfirmEdit - bug T44145