jenkins-bot has submitted this change and it was merged.

Change subject: Remove pre-1.25 API compatibility code
......................................................................


Remove pre-1.25 API compatibility code

Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: I31b96b0939d5321be31889422cfc703c9c6c2baa
---
M FancyCaptcha/ApiFancyCaptchaReload.php
M ReCaptcha/ReCaptcha.class.php
M ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.class.php
M SimpleCaptcha/Captcha.php
M extension.json
M includes/ConfirmEditHooks.php
6 files changed, 15 insertions(+), 89 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/FancyCaptcha/ApiFancyCaptchaReload.php 
b/FancyCaptcha/ApiFancyCaptchaReload.php
index bdeb2c9..d53d7ba 100644
--- a/FancyCaptcha/ApiFancyCaptchaReload.php
+++ b/FancyCaptcha/ApiFancyCaptchaReload.php
@@ -17,22 +17,8 @@
                return true;
        }
 
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getDescription() {
-               return 'Get a new FancyCaptcha.';
-       }
-
        public function getAllowedParams() {
                return [];
-       }
-
-       /**
-        * @deprecated since MediaWiki core 1.25
-        */
-       public function getExamples() {
-               return [ 'api.php?action=fancycaptchareload&format=xml' ];
        }
 
        /**
diff --git a/ReCaptcha/ReCaptcha.class.php b/ReCaptcha/ReCaptcha.class.php
index 123f643..84d7711 100644
--- a/ReCaptcha/ReCaptcha.class.php
+++ b/ReCaptcha/ReCaptcha.class.php
@@ -83,30 +83,12 @@
 
        public function APIGetAllowedParams( &$module, &$params, $flags ) {
                if ( $flags && $this->isAPICaptchaModule( $module ) ) {
-                       if ( defined( 'ApiBase::PARAM_HELP_MSG' ) ) {
-                               $params['recaptcha_challenge_field'] = [
-                                       ApiBase::PARAM_HELP_MSG => 
'recaptcha-apihelp-param-recaptcha_challenge_field',
-                               ];
-                               $params['recaptcha_response_field'] = [
-                                       ApiBase::PARAM_HELP_MSG => 
'recaptcha-apihelp-param-recaptcha_response_field',
-                               ];
-                       } else {
-                               // @todo: Remove this branch when support for 
MediaWiki < 1.25 is dropped
-                               $params['recaptcha_challenge_field'] = null;
-                               $params['recaptcha_response_field'] = null;
-                       }
-               }
-
-               return true;
-       }
-
-       /**
-        * @deprecated since MediaWiki 1.25
-        */
-       public function APIGetParamDescription( &$module, &$desc ) {
-               if ( $this->isAPICaptchaModule( $module ) ) {
-                       $desc['recaptcha_challenge_field'] = 'Field from the 
ReCaptcha widget';
-                       $desc['recaptcha_response_field'] = 'Field from the 
ReCaptcha widget';
+                       $params['recaptcha_challenge_field'] = [
+                               ApiBase::PARAM_HELP_MSG => 
'recaptcha-apihelp-param-recaptcha_challenge_field',
+                       ];
+                       $params['recaptcha_response_field'] = [
+                               ApiBase::PARAM_HELP_MSG => 
'recaptcha-apihelp-param-recaptcha_response_field',
+                       ];
                }
 
                return true;
diff --git a/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.class.php 
b/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.class.php
index 6c94795..90fc9a6 100644
--- a/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.class.php
+++ b/ReCaptchaNoCaptcha/ReCaptchaNoCaptcha.class.php
@@ -154,25 +154,9 @@
 
        public function APIGetAllowedParams( &$module, &$params, $flags ) {
                if ( $flags && $this->isAPICaptchaModule( $module ) ) {
-                       if ( defined( 'ApiBase::PARAM_HELP_MSG' ) ) {
-                               $params['g-recaptcha-response'] = [
-                                       ApiBase::PARAM_HELP_MSG => 
'renocaptcha-apihelp-param-g-recaptcha-response',
-                               ];
-                       } else {
-                               // @todo: Remove this branch when support for 
MediaWiki < 1.25 is dropped
-                               $params['g-recaptcha-response'] = null;
-                       }
-               }
-
-               return true;
-       }
-
-       /**
-        * @deprecated since MediaWiki 1.25
-        */
-       public function APIGetParamDescription( &$module, &$desc ) {
-               if ( $this->isAPICaptchaModule( $module ) ) {
-                       $desc['g-recaptcha-response'] = 'Field from the 
ReCaptcha widget';
+                       $params['g-recaptcha-response'] = [
+                               ApiBase::PARAM_HELP_MSG => 
'renocaptcha-apihelp-param-g-recaptcha-response',
+                       ];
                }
 
                return true;
diff --git a/SimpleCaptcha/Captcha.php b/SimpleCaptcha/Captcha.php
index 14f217a..96f7d16 100644
--- a/SimpleCaptcha/Captcha.php
+++ b/SimpleCaptcha/Captcha.php
@@ -1072,33 +1072,12 @@
         */
        public function APIGetAllowedParams( &$module, &$params, $flags ) {
                if ( $this->isAPICaptchaModule( $module ) ) {
-                       if ( defined( 'ApiBase::PARAM_HELP_MSG' ) ) {
-                               $params['captchaword'] = [
-                                       ApiBase::PARAM_HELP_MSG => 
'captcha-apihelp-param-captchaword',
-                               ];
-                               $params['captchaid'] = [
-                                       ApiBase::PARAM_HELP_MSG => 
'captcha-apihelp-param-captchaid',
-                               ];
-                       } else {
-                               // @todo: Remove this branch when support for 
MediaWiki < 1.25 is dropped
-                               $params['captchaword'] = null;
-                               $params['captchaid'] = null;
-                       }
-               }
-
-               return true;
-       }
-
-       /**
-        * @deprecated Since MediaWiki 1.25
-        * @param $module ApiBase
-        * @param $desc array
-        * @return bool
-        */
-       public function APIGetParamDescription( &$module, &$desc ) {
-               if ( $this->isAPICaptchaModule( $module ) ) {
-                       $desc['captchaid'] = 'CAPTCHA ID from previous request';
-                       $desc['captchaword'] = 'Answer to the CAPTCHA';
+                       $params['captchaword'] = [
+                               ApiBase::PARAM_HELP_MSG => 
'captcha-apihelp-param-captchaword',
+                       ];
+                       $params['captchaid'] = [
+                               ApiBase::PARAM_HELP_MSG => 
'captcha-apihelp-param-captchaid',
+                       ];
                }
 
                return true;
diff --git a/extension.json b/extension.json
index 59372cf..095f952 100644
--- a/extension.json
+++ b/extension.json
@@ -76,7 +76,6 @@
                "EditPage::showEditForm:fields": 
"ConfirmEditHooks::showEditFormFields",
                "EditFilterMergedContent": 
"ConfirmEditHooks::confirmEditMerged",
                "APIGetAllowedParams": "ConfirmEditHooks::APIGetAllowedParams",
-               "APIGetParamDescription": 
"ConfirmEditHooks::APIGetParamDescription",
                "TitleReadWhitelist": "ConfirmEditHooks::onTitleReadWhitelist",
                "AlternateEditPreview": 
"ConfirmEditHooks::onAlternateEditPreview"
        },
diff --git a/includes/ConfirmEditHooks.php b/includes/ConfirmEditHooks.php
index 80e25d2..8e445c0 100644
--- a/includes/ConfirmEditHooks.php
+++ b/includes/ConfirmEditHooks.php
@@ -128,10 +128,6 @@
                return self::getInstance()->APIGetAllowedParams( $module, 
$params, $flags );
        }
 
-       public static function APIGetParamDescription( &$module, &$desc ) {
-               return self::getInstance()->APIGetParamDescription( $module, 
$desc );
-       }
-
        public static function onAuthChangeFormFields(
                array $requests, array $fieldInfo, array &$formDescriptor, 
$action
        ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/311779
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I31b96b0939d5321be31889422cfc703c9c6c2baa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ConfirmEdit
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to