MW_SUPPORTS_EDITFILTERMERGED has been in since r27416
authorSam Reed <reedy@users.mediawiki.org>
Wed, 23 Nov 2011 19:18:30 +0000 (19:18 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 23 Nov 2011 19:18:30 +0000 (19:18 +0000)
Kill the alternate EditFilter hook usage (underlying code still used, probably wants refactoring at somepoint)

Simplify a boolean return

Captcha.php
ConfirmEdit.php
ConfirmEditHooks.php

index a67870c8e61e444cc834753bb415bff98b53d961..2b32b4eb61e02e114e13b7cd2dffab2a7fa209c7 100644 (file)
@@ -645,11 +645,7 @@ class SimpleCaptcha {
         */
        private function doConfirmEdit( $editPage, $newtext, $section, $merged = false ) {
                if ( $this->shouldCheck( $editPage, $newtext, $section, $merged ) ) {
-                       if ( $this->passCaptcha() ) {
-                               return true;
-                       } else {
-                               return false;
-                       }
+                       return $this->passCaptcha();
                } else {
                        wfDebug( "ConfirmEdit: no need to show captcha.\n" );
                        return true;
@@ -686,7 +682,6 @@ class SimpleCaptcha {
                return $this->confirmEdit( $editPage, $newtext, false, true );
        }
 
-
        function confirmEditAPI( $editPage, $newtext, &$resultArr ) {
                if ( !$this->doConfirmEdit( $editPage, $newtext, false, false ) ) {
                        $this->addCaptchaAPI( $resultArr );
index 1231212dbb40274eda44ac168cdf8e0f959d883f..f11eb7d6dfbcf638d01b8ea0a13b3d66a312b1ab 100644 (file)
@@ -185,11 +185,7 @@ $wgConfirmEditIP = dirname( __FILE__ );
 $wgExtensionMessagesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.i18n.php";
 $wgExtensionAliasesFiles['ConfirmEdit'] = "$wgConfirmEditIP/ConfirmEdit.alias.php";
 
-if ( defined( 'MW_SUPPORTS_EDITFILTERMERGED' ) ) {
-       $wgHooks['EditFilterMerged'][] = 'ConfirmEditHooks::confirmEditMerged';
-} else {
-       $wgHooks['EditFilter'][] = 'ConfirmEditHooks::confirmEdit';
-}
+$wgHooks['EditFilterMerged'][] = 'ConfirmEditHooks::confirmEditMerged';
 $wgHooks['UserCreateForm'][] = 'ConfirmEditHooks::injectUserCreate';
 $wgHooks['AbortNewAccount'][] = 'ConfirmEditHooks::confirmUserCreate';
 $wgHooks['LoginAuthenticateAudit'][] = 'ConfirmEditHooks::triggerUserLogin';
index 137821c4941909e7d6fd6c4fdb6b35198b91c797..f31a6619811ef6d65b135518cdea02b3cf259834 100644 (file)
@@ -17,10 +17,6 @@ class ConfirmEditHooks {
                return $wgCaptcha;
        }
 
-       static function confirmEdit( $editPage, $newtext, $section ) {
-               return self::getInstance()->confirmEdit( $editPage, $newtext, $section );
-       }
-
        static function confirmEditMerged( $editPage, $newtext ) {
                return self::getInstance()->confirmEditMerged( $editPage, $newtext );
        }