Fixing captcha url (broken in #128, see also #129)

This commit is contained in:
Gregwar 2015-05-25 11:41:13 +02:00
parent 4aba359e71
commit 448b812f65
2 changed files with 3 additions and 2 deletions

View File

@ -76,7 +76,8 @@ class CaptchaGenerator
// Returns the image generation URL // Returns the image generation URL
if ($options['as_url']) { if ($options['as_url']) {
return $this->router->generate('gregwar_captcha.generate_captcha', array('key' => $options['session_key'])); return $this->router->generate('gregwar_captcha.generate_captcha',
array('key' => $options['session_key'], 'n' => time()));
} }
return 'data:image/jpeg;base64,' . base64_encode($this->generate($options)); return 'data:image/jpeg;base64,' . base64_encode($this->generate($options));

View File

@ -3,7 +3,7 @@
- -
{% else %} {% else %}
{% spaceless %} {% spaceless %}
<img id="{{ image_id }}" src="{{ captcha_code }}?n={{ 'now'|date('U') }}" alt="" title="captcha" width="{{ captcha_width }}" height="{{ captcha_height }}" /> <img id="{{ image_id }}" src="{{ captcha_code }}" alt="" title="captcha" width="{{ captcha_width }}" height="{{ captcha_height }}" />
{% if reload %} {% if reload %}
<script type="text/javascript"> <script type="text/javascript">
function reload_{{ image_id }}() { function reload_{{ image_id }}() {