From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- extensions/ConfirmEdit/Captcha.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'extensions/ConfirmEdit/Captcha.php') diff --git a/extensions/ConfirmEdit/Captcha.php b/extensions/ConfirmEdit/Captcha.php index 0f78d36f..9967dd47 100644 --- a/extensions/ConfirmEdit/Captcha.php +++ b/extensions/ConfirmEdit/Captcha.php @@ -42,6 +42,7 @@ class SimpleCaptcha { Xml::element( 'input', array( 'name' => 'wpCaptchaWord', 'id' => 'wpCaptchaWord', + 'autocomplete' => 'off', 'tabindex' => 1 ) ) . // tab in before the edit textarea "

\n" . Xml::element( 'input', array( @@ -575,17 +576,25 @@ class SimpleCaptcha { return true; } + /** + * @param $module ApiBase + * @return bool + */ + protected function isAPICaptchaModule( $module ) { + return $module instanceof ApiEditPage; + } + /** * @param $module ApiBase * @param $params array + * @param $flags int * @return bool */ - public function APIGetAllowedParams( &$module, &$params ) { - if ( !$module instanceof ApiEditPage ) { - return true; + public function APIGetAllowedParams( &$module, &$params, $flags ) { + if ( $flags && $this->isAPICaptchaModule( $module ) ) { + $params['captchaword'] = null; + $params['captchaid'] = null; } - $params['captchaword'] = null; - $params['captchaid'] = null; return true; } @@ -596,11 +605,10 @@ class SimpleCaptcha { * @return bool */ public function APIGetParamDescription( &$module, &$desc ) { - if ( !$module instanceof ApiEditPage ) { - return true; + if ( $this->isAPICaptchaModule( $module ) ) { + $desc['captchaid'] = 'CAPTCHA ID from previous request'; + $desc['captchaword'] = 'Answer to the CAPTCHA'; } - $desc['captchaid'] = 'CAPTCHA ID from previous request'; - $desc['captchaword'] = 'Answer to the CAPTCHA'; return true; } -- cgit v1.2.2