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
This commit is contained in:
Sam Reed 2011-11-23 19:18:30 +00:00
parent 64b6239348
commit 0a66fd76f1
Notes: Sam Reed 2011-11-23 19:18:30 +00:00
3 changed files with 2 additions and 15 deletions

View 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 );

View 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';

View 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 );
}