Fix hook copy paste fail

Move rest of captcha params out of api/ApiEditPage.php
This commit is contained in:
Sam Reed 2011-11-23 20:37:13 +00:00
parent 80e9b337ee
commit 9e4951f262
Notes: Sam Reed 2011-11-23 20:37:13 +00:00
2 changed files with 8 additions and 1 deletions

View file

@ -428,6 +428,13 @@ class SimpleCaptcha {
* @return bool false if the CAPTCHA is rejected, true otherwise
*/
private function doConfirmEdit( $editPage, $newtext, $section, $merged = false ) {
global $wgRequest;
if ( $wgRequest->getVal( 'captchaid' ) ) {
$wgRequest->setVal( 'wpCaptchaId', $wgRequest->getVal( 'captchaid' ) );
}
if ( $wgRequest->getVal( 'captchaword' ) ) {
$wgRequest->setVal( 'wpCaptchaWord', $wgRequest->getVal( 'captchaword' ) );
}
if ( $this->shouldCheck( $editPage, $newtext, $section, $merged ) ) {
return $this->passCaptcha();
} else {

View file

@ -196,7 +196,7 @@ $wgHooks['EmailUser'][] = 'ConfirmEditHooks::confirmEmailUser';
# Register API hook
$wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI';
$wgHooks['APIGetAllowedParams'][] = 'ConfirmEditHooks::APIGetAllowedParams';
$wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::APIEditBeforeSave';
$wgHooks['APIGetParamDescription'][] = 'ConfirmEditHooks::APIGetParamDescription';
$wgAutoloadClasses['ConfirmEditHooks'] = "$wgConfirmEditIP/ConfirmEditHooks.php";
$wgAutoloadClasses['SimpleCaptcha']= "$wgConfirmEditIP/Captcha.php";