From 0a66fd76f12ac9158842e8e2316bf7508c9e878b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 23 Nov 2011 19:18:30 +0000 Subject: [PATCH] MW_SUPPORTS_EDITFILTERMERGED has been in since r27416 Kill the alternate EditFilter hook usage (underlying code still used, probably wants refactoring at somepoint) Simplify a boolean return --- Captcha.php | 7 +------ ConfirmEdit.php | 6 +----- ConfirmEditHooks.php | 4 ---- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Captcha.php b/Captcha.php index a67870c8e..2b32b4eb6 100644 --- a/Captcha.php +++ b/Captcha.php @@ -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 ); diff --git a/ConfirmEdit.php b/ConfirmEdit.php index 1231212db..f11eb7d6d 100644 --- a/ConfirmEdit.php +++ b/ConfirmEdit.php @@ -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'; diff --git a/ConfirmEditHooks.php b/ConfirmEditHooks.php index 137821c49..f31a66198 100644 --- a/ConfirmEditHooks.php +++ b/ConfirmEditHooks.php @@ -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 ); }