w/s fixups before real changes.

This commit is contained in:
Mark A. Hershberger 2011-12-01 16:42:11 +00:00
parent d40e00b39a
commit 26408799a5
Notes: Mark A. Hershberger 2011-12-01 16:42:11 +00:00

View file

@ -55,8 +55,8 @@ function efReCaptcha() {
if ($wgReCaptchaPublicKey == '' || $wgReCaptchaPrivateKey == '') { if ($wgReCaptchaPublicKey == '' || $wgReCaptchaPrivateKey == '') {
die ('You need to set $wgReCaptchaPrivateKey and $wgReCaptchaPublicKey in LocalSettings.php to ' . die ('You need to set $wgReCaptchaPrivateKey and $wgReCaptchaPublicKey in LocalSettings.php to ' .
"use the reCAPTCHA plugin. You can sign up for a key <a href='" . "use the reCAPTCHA plugin. You can sign up for a key <a href='" .
htmlentities(recaptcha_get_signup_url ($wgServerName, "mediawiki")) . "'>here</a>."); htmlentities(recaptcha_get_signup_url ($wgServerName, "mediawiki")) . "'>here</a>.");
} }
} }
@ -68,9 +68,9 @@ class ReCaptcha extends SimpleCaptcha {
/** /**
* Displays the reCAPTCHA widget. * Displays the reCAPTCHA widget.
* If $this->recaptcha_error is set, it will display an error in the widget. * If $this->recaptcha_error is set, it will display an error in the widget.
* *
*/ */
function getForm() { function getForm() {
global $wgReCaptchaPublicKey, $wgReCaptchaTheme; global $wgReCaptchaPublicKey, $wgReCaptchaTheme;
$useHttps = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ); $useHttps = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' );
@ -82,21 +82,21 @@ class ReCaptcha extends SimpleCaptcha {
/** /**
* Calls the library function recaptcha_check_answer to verify the users input. * Calls the library function recaptcha_check_answer to verify the users input.
* Sets $this->recaptcha_error if the user is incorrect. * Sets $this->recaptcha_error if the user is incorrect.
* @return boolean * @return boolean
* *
*/ */
function passCaptcha() { function passCaptcha() {
global $wgReCaptchaPrivateKey; global $wgReCaptchaPrivateKey;
$recaptcha_response = recaptcha_check_answer ($wgReCaptchaPrivateKey, $recaptcha_response = recaptcha_check_answer ($wgReCaptchaPrivateKey,
wfGetIP (), wfGetIP (),
$_POST['recaptcha_challenge_field'], $_POST['recaptcha_challenge_field'],
$_POST['recaptcha_response_field']); $_POST['recaptcha_response_field']);
if (!$recaptcha_response->is_valid) { if (!$recaptcha_response->is_valid) {
$this->recaptcha_error = $recaptcha_response->error; $this->recaptcha_error = $recaptcha_response->error;
return false; return false;
} }
$recaptcha_error = null; $recaptcha_error = null;
return true; return true;
} }