X-Git-Url: https://git.toastfreeware.priv.at/toast/cookiecaptcha.git/blobdiff_plain/89349038f93b1aa2efa828c91dae803d9c80e679..c7b30198527052bc7db36acd3ee9e826bc1029db:/QuestyCaptcha.class.php diff --git a/QuestyCaptcha.class.php b/QuestyCaptcha.class.php index 16dff06..8e87db3 100644 --- a/QuestyCaptcha.class.php +++ b/QuestyCaptcha.class.php @@ -12,7 +12,11 @@ class QuestyCaptcha extends SimpleCaptcha { /** 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 ) { @@ -36,9 +40,10 @@ class QuestyCaptcha extends SimpleCaptcha { } $index = $this->storeCaptcha( $captcha ); return "
" . - Xml::element( 'input', array( + Html::element( 'input', array( 'name' => 'wpCaptchaWord', 'id' => 'wpCaptchaWord', + 'required', 'tabindex' => 1 ) ) . // tab in before the edit textarea "
\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' ) ); - if ( $this->storage->cookiesNeeded() ) { + if ( CaptchaStore::get()->cookiesNeeded() ) { $wgOut->addWikiText( wfMsg( 'captchahelp-cookies-needed' ) ); } }