diff options
author | Eric Helgeson <erichelgeson@gmail.com> | 2009-12-07 14:53:17 -0500 |
---|---|---|
committer | Eric Helgeson <erichelgeson@gmail.com> | 2009-12-07 14:53:17 -0500 |
commit | 684e65e3dea09fd8179f86d846b82540cc44e5dc (patch) | |
tree | 63cd1999f7430de2a77388d8ffd5ab8a5af84399 /plugins | |
parent | 048f07a1e6dae878c23baa6d3d8afc19cf397c10 (diff) |
Cleanup of recaptcha plugin remove xhtml hack
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Recaptcha/RecaptchaPlugin.php | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/plugins/Recaptcha/RecaptchaPlugin.php b/plugins/Recaptcha/RecaptchaPlugin.php index 3a510ef11..db118dbb8 100644 --- a/plugins/Recaptcha/RecaptchaPlugin.php +++ b/plugins/Recaptcha/RecaptchaPlugin.php @@ -44,11 +44,11 @@ class RecaptchaPlugin extends Plugin var $ssl; function onInitializePlugin(){ - if(!isset($this->private_key)){ - common_log(LOG_ERR, "Recaptcha: Must specify private_key in config.php"); + if(!isset($this->private_key)) { + common_log(LOG_ERR, 'Recaptcha: Must specify private_key in config.php'); } - if(!isset($this->public_key)){ - common_log(LOG_ERR, "Recaptcha: Must specify public_key in config.php"); + if(!isset($this->public_key)) { + common_log(LOG_ERR, 'Recaptcha: Must specify public_key in config.php'); } } @@ -59,25 +59,13 @@ class RecaptchaPlugin extends Plugin return false; } - function onStartShowHTML($action) - { - //XXX: Horrible hack to make Safari, FF2, and Chrome work with - //reChapcha. reChapcha beaks xhtml strict - header('Content-Type: text/html'); - - $action->extraHeaders(); - - $action->startXML('html'); - - $action->style('#recaptcha_area{float:left;}'); - return false; - } function onEndRegistrationFormData($action) { + $action->style('#recaptcha_area{float:left;}'); $action->elementStart('li'); $action->raw('<label for="recaptcha_area">Captcha</label>'); - if($this->checkssl() === true){ + if($this->checkssl() === true) { $action->raw(recaptcha_get_html($this->public_key), null, true); } else { $action->raw(recaptcha_get_html($this->public_key)); @@ -93,11 +81,9 @@ class RecaptchaPlugin extends Plugin $action->trimmed('recaptcha_challenge_field'), $action->trimmed('recaptcha_response_field')); - if (!$resp->is_valid) - { - if($this->display_errors) - { - $action->showForm ("(reCAPTCHA said: " . $resp->error . ")"); + if (!$resp->is_valid) { + if($this->display_errors) { + $action->showForm ("(reCAPTCHA error: " . $resp->error . ")"); } $action->showForm("Captcha does not match!"); return false; |