summaryrefslogtreecommitdiff
path: root/extensions/ConfirmEdit/Captcha.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /extensions/ConfirmEdit/Captcha.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'extensions/ConfirmEdit/Captcha.php')
-rw-r--r--extensions/ConfirmEdit/Captcha.php26
1 files changed, 17 insertions, 9 deletions
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
"</p>\n" .
Xml::element( 'input', array(
@@ -577,15 +578,23 @@ class SimpleCaptcha {
/**
* @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;
}