Permalink
Browse files

Fixed bug #28: handle `ewz_recaptcha_enabled` if disabled

  • Loading branch information...
1 parent 370163a commit 946dafffba58e959a21069f85c2fd3e25861d322 @excelwebzone committed Jul 23, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 Form/Type/RecaptchaType.php
@@ -67,6 +67,10 @@ public function __construct(ContainerInterface $container)
*/
public function buildView(FormView $view, FormInterface $form, array $options)
{
+ $view->vars = array_replace($view->vars, array(
+ 'ewz_recaptcha_enabled' => $this->enabled,
+ ));
+
if (!$this->enabled) {
return;
}
@@ -78,10 +82,9 @@ public function buildView(FormView $view, FormInterface $form, array $options)
}
$view->vars = array_replace($view->vars, array(
- 'url_challenge' => $server.'/challenge?k='.$this->publicKey,
- 'url_noscript' => $server.'/noscript?k='.$this->publicKey,
- 'public_key' => $this->publicKey,
- 'ewz_recaptcha_enabled' => $this->enabled,
+ 'url_challenge' => sprintf('%s/challenge?k=%s', $server, $this->publicKey),
+ 'url_noscript' => sprintf('%s/noscript?k=%s', $server, $this->publicKey),
+ 'public_key' => $this->publicKey,
));
}

0 comments on commit 946daff

Please sign in to comment.