Index: trunk/phase3/includes/api/ApiEditPage.php |
— | — | @@ -239,13 +239,6 @@ |
240 | 240 | $ep->setContextTitle( $titleObj ); |
241 | 241 | $ep->importFormData( $req ); |
242 | 242 | |
243 | | - if ( isset( $params['captchaid'] ) && !is_null( $params['captchaid'] ) ) { |
244 | | - $wgRequest->setVal( 'wpCaptchaId', $params['captchaid'] ); |
245 | | - } |
246 | | - if ( isset( $params['captchaword'] ) && !is_null( $params['captchaword'] ) ) { |
247 | | - $wgRequest->setVal( 'wpCaptchaWord', $params['captchaword'] ); |
248 | | - } |
249 | | - |
250 | 243 | // Run hooks |
251 | 244 | // Handle APIEditBeforeSave parameters |
252 | 245 | $r = array(); |
Index: trunk/extensions/ConfirmEdit/Captcha.php |
— | — | @@ -428,6 +428,13 @@ |
429 | 429 | * @return bool false if the CAPTCHA is rejected, true otherwise |
430 | 430 | */ |
431 | 431 | private function doConfirmEdit( $editPage, $newtext, $section, $merged = false ) { |
| 432 | + global $wgRequest; |
| 433 | + if ( $wgRequest->getVal( 'captchaid' ) ) { |
| 434 | + $wgRequest->setVal( 'wpCaptchaId', $wgRequest->getVal( 'captchaid' ) ); |
| 435 | + } |
| 436 | + if ( $wgRequest->getVal( 'captchaword' ) ) { |
| 437 | + $wgRequest->setVal( 'wpCaptchaWord', $wgRequest->getVal( 'captchaword' ) ); |
| 438 | + } |
432 | 439 | if ( $this->shouldCheck( $editPage, $newtext, $section, $merged ) ) { |
433 | 440 | return $this->passCaptcha(); |
434 | 441 | } else { |
Index: trunk/extensions/ConfirmEdit/ConfirmEdit.php |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | # Register API hook |
198 | 198 | $wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::confirmEditAPI'; |
199 | 199 | $wgHooks['APIGetAllowedParams'][] = 'ConfirmEditHooks::APIGetAllowedParams'; |
200 | | -$wgHooks['APIEditBeforeSave'][] = 'ConfirmEditHooks::APIEditBeforeSave'; |
| 200 | +$wgHooks['APIGetParamDescription'][] = 'ConfirmEditHooks::APIGetParamDescription'; |
201 | 201 | |
202 | 202 | $wgAutoloadClasses['ConfirmEditHooks'] = "$wgConfirmEditIP/ConfirmEditHooks.php"; |
203 | 203 | $wgAutoloadClasses['SimpleCaptcha']= "$wgConfirmEditIP/Captcha.php"; |