r106119 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106118‎ | r106119 | r106120 >
Date:22:29, 13 December 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
follow up to r106097 - somehow managed to remove a line o_O also did some stylizing
Modified paths:
  • /trunk/extensions/ConfirmEdit/ReCaptcha.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ReCaptcha.php
@@ -86,29 +86,31 @@
8787 *
8888 */
8989 function passCaptcha() {
90 - global $wgReCaptchaPrivateKey;
91 - global $wgRequest;
 90+ global $wgReCaptchaPrivateKey, $wgRequest;
9291
9392 //API is hardwired to return wpCaptchaId and wpCaptchaWord, so use that if the standard two are empty
94 - $challenge = $wgRequest->getVal('recaptcha_challenge_field',$wgRequest->getVal('wpCaptchaId'));
95 - $response = $wgRequest->getVal('recaptcha_response_field',$wgRequest->getVal('wpCaptchaWord'));
 93+ $challenge = $wgRequest->getVal( 'recaptcha_challenge_field', $wgRequest->getVal( 'wpCaptchaId' ) );
 94+ $response = $wgRequest->getVal( 'recaptcha_response_field', $wgRequest->getVal( 'wpCaptchaWord' ) );
 95+
9696 if ( $response === null ) {
9797 //new captcha session
9898 return false;
9999 }
100100
 101+ $recaptcha_response = recaptcha_check_answer(
 102+ $wgReCaptchaPrivateKey,
 103+ $wgRequest->getIP(),
 104+ $challenge,
 105+ $response
 106+ );
101107
102 - recaptcha_check_answer (
103 - $wgReCaptchaPrivateKey,
104 - $wgRequest->getIP(),
105 - $challenge,
106 - $response
107 - );
108108 if (!$recaptcha_response->is_valid) {
109109 $this->recaptcha_error = $recaptcha_response->error;
110110 return false;
111111 }
 112+
112113 $recaptcha_error = null;
 114+
113115 return true;
114116
115117 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106097kill wfGetIPjeroendedauw21:24, 13 December 2011

Status & tagging log