mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
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:
parent
64b6239348
commit
0a66fd76f1
Notes:
Sam Reed
2011-11-23 19:18:30 +00:00
|
@ -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 );
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue