ToastFreeware
/
toast
/
cookiecaptcha.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't check badlogin attempts in memcached if we are not configured to show captchas...
[toast/cookiecaptcha.git]
/
QuestyCaptcha.class.php
diff --git
a/QuestyCaptcha.class.php
b/QuestyCaptcha.class.php
index 16dff06c99dac8eef04c82cc9f11ff2cf111df1e..8e87db3051a26622b7f126b1941c08955cf1f80f 100644
(file)
--- a/
QuestyCaptcha.class.php
+++ b/
QuestyCaptcha.class.php
@@
-12,7
+12,11
@@
class QuestyCaptcha extends SimpleCaptcha {
/** Validate a captcha response */
function keyMatch( $answer, $info ) {
/** Validate a captcha response */
function keyMatch( $answer, $info ) {
- return strtolower( $answer ) == strtolower( $info['answer'] );
+ if ( is_array( $info['answer'] ) ) {
+ return in_array( strtolower( $answer ), $info['answer'] );
+ } else {
+ return strtolower( $answer ) == strtolower( $info['answer'] );
+ }
}
function addCaptchaAPI( &$resultArr ) {
}
function addCaptchaAPI( &$resultArr ) {
@@
-36,9
+40,10
@@
class QuestyCaptcha extends SimpleCaptcha {
}
$index = $this->storeCaptcha( $captcha );
return "<p><label for=\"wpCaptchaWord\">{$captcha['question']}</label> " .
}
$index = $this->storeCaptcha( $captcha );
return "<p><label for=\"wpCaptchaWord\">{$captcha['question']}</label> " .
-
X
ml::element( 'input', array(
+
Ht
ml::element( 'input', array(
'name' => 'wpCaptchaWord',
'id' => 'wpCaptchaWord',
'name' => 'wpCaptchaWord',
'id' => 'wpCaptchaWord',
+ 'required',
'tabindex' => 1 ) ) . // tab in before the edit textarea
"</p>\n" .
Xml::element( 'input', array(
'tabindex' => 1 ) ) . // tab in before the edit textarea
"</p>\n" .
Xml::element( 'input', array(
@@
-60,7
+65,7
@@
class QuestyCaptcha extends SimpleCaptcha {
global $wgOut;
$wgOut->setPageTitle( wfMsg( 'captchahelp-title' ) );
$wgOut->addWikiText( wfMsg( 'questycaptchahelp-text' ) );
global $wgOut;
$wgOut->setPageTitle( wfMsg( 'captchahelp-title' ) );
$wgOut->addWikiText( wfMsg( 'questycaptchahelp-text' ) );
- if (
$this->storage
->cookiesNeeded() ) {
+ if (
CaptchaStore::get()
->cookiesNeeded() ) {
$wgOut->addWikiText( wfMsg( 'captchahelp-cookies-needed' ) );
}
}
$wgOut->addWikiText( wfMsg( 'captchahelp-cookies-needed' ) );
}
}