Mailing List Archive

SVN: [106097] trunk/extensions/ConfirmEdit
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106097

Revision: 106097
Author: jeroendedauw
Date: 2011-12-13 21:24:03 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
kill wfGetIP

Modified Paths:
--------------
trunk/extensions/ConfirmEdit/Captcha.php
trunk/extensions/ConfirmEdit/ReCaptcha.php

Modified: trunk/extensions/ConfirmEdit/Captcha.php
===================================================================
--- trunk/extensions/ConfirmEdit/Captcha.php 2011-12-13 21:19:10 UTC (rev 106096)
+++ trunk/extensions/ConfirmEdit/Captcha.php 2011-12-13 21:24:03 UTC (rev 106097)
@@ -177,8 +177,12 @@
*/
function isIPWhitelisted() {
global $wgCaptchaWhitelistIP;
+
if ( $wgCaptchaWhitelistIP ) {
- $ip = wfGetIp();
+ global $wgRequest;
+
+ $ip = $wgRequest->getIP();
+
foreach ( $wgCaptchaWhitelistIP as $range ) {
if ( IP::isInRange( $ip, $range ) ) {
return true;
@@ -194,7 +198,8 @@
* @access private
*/
function badLoginKey() {
- return wfMemcKey( 'captcha', 'badlogin', 'ip', wfGetIP() );
+ global $wgRequest;
+ return wfMemcKey( 'captcha', 'badlogin', 'ip', $wgRequest->getIP() );
}

/**

Modified: trunk/extensions/ConfirmEdit/ReCaptcha.php
===================================================================
--- trunk/extensions/ConfirmEdit/ReCaptcha.php 2011-12-13 21:19:10 UTC (rev 106096)
+++ trunk/extensions/ConfirmEdit/ReCaptcha.php 2011-12-13 21:24:03 UTC (rev 106097)
@@ -97,10 +97,10 @@
return false;
}

- $recaptcha_response =
+
recaptcha_check_answer (
$wgReCaptchaPrivateKey,
- wfGetIP (),
+ $wgRequest->getIP(),
$challenge,
$response
);


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs