r106097 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106096‎ | r106097 | r106098 >
Date:21:24, 13 December 2011
Author:jeroendedauw
Status:resolved (Comments)
Tags:
Comment:
kill wfGetIP
Modified paths:
  • /trunk/extensions/ConfirmEdit/Captcha.php (modified) (history)
  • /trunk/extensions/ConfirmEdit/ReCaptcha.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmEdit/ReCaptcha.php
@@ -97,10 +97,10 @@
9898 return false;
9999 }
100100
101 - $recaptcha_response =
 101+
102102 recaptcha_check_answer (
103103 $wgReCaptchaPrivateKey,
104 - wfGetIP (),
 104+ $wgRequest->getIP(),
105105 $challenge,
106106 $response
107107 );
Index: trunk/extensions/ConfirmEdit/Captcha.php
@@ -177,8 +177,12 @@
178178 */
179179 function isIPWhitelisted() {
180180 global $wgCaptchaWhitelistIP;
 181+
181182 if ( $wgCaptchaWhitelistIP ) {
182 - $ip = wfGetIp();
 183+ global $wgRequest;
 184+
 185+ $ip = $wgRequest->getIP();
 186+
183187 foreach ( $wgCaptchaWhitelistIP as $range ) {
184188 if ( IP::isInRange( $ip, $range ) ) {
185189 return true;
@@ -194,7 +198,8 @@
195199 * @access private
196200 */
197201 function badLoginKey() {
198 - return wfMemcKey( 'captcha', 'badlogin', 'ip', wfGetIP() );
 202+ global $wgRequest;
 203+ return wfMemcKey( 'captcha', 'badlogin', 'ip', $wgRequest->getIP() );
199204 }
200205
201206 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r106119follow up to r106097 - somehow managed to remove a line o_O also did some sty...jeroendedauw22:29, 13 December 2011

Comments

#Comment by Jeroen De Dauw (talk | contribs)   22:29, 13 December 2011

Assignment to $recaptcha_response added back in follow up

Status & tagging log