diff --git a/DependencyInjection/GregwarCaptchaExtension.php b/DependencyInjection/GregwarCaptchaExtension.php index 75b7246..83f4ddb 100755 --- a/DependencyInjection/GregwarCaptchaExtension.php +++ b/DependencyInjection/GregwarCaptchaExtension.php @@ -33,10 +33,6 @@ class GregwarCaptchaExtension extends Extension $container->setParameter('gregwar_captcha.config.expiration', $config['expiration']); $container->setParameter('gregwar_captcha.config.whitelist_key', $config['whitelist_key']); - if ($config['reload'] && !$config['as_url']) { - throw new \InvalidArgumentException('GregwarCaptcha: The reload option cannot be set without as_url, see the README for more information'); - } - $resources = $container->getParameter('twig.form.resources'); $container->setParameter('twig.form.resources', array_merge(array('GregwarCaptchaBundle::captcha.html.twig'), $resources)); } diff --git a/Type/CaptchaType.php b/Type/CaptchaType.php index 2a90ed7..2b10374 100644 --- a/Type/CaptchaType.php +++ b/Type/CaptchaType.php @@ -90,6 +90,10 @@ class CaptchaType extends AbstractType { $isHuman = false; + if ($options['reload'] && !$options['as_url']) { + throw new \InvalidArgumentException('GregwarCaptcha: The reload option cannot be set without as_url, see the README for more information'); + } + if ($options['humanity'] > 0) { $humanityKey = $this->key.'_humanity'; if ($this->session->get($humanityKey, 0) > 0) {