Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Text based CAPTCHAs don't call update_response_session() #8

Open
nickolasgregory opened this issue Sep 7, 2010 · 0 comments
Open

Comments

@nickolasgregory
Copy link

As text based CAPTCHAs (riddle, math) are rendered without using the route or controller, the method update_response_session() is never called.
Adding this line before the return (string) in render() will fix this;

$this->update_response_session();

I guess making captcha.php like;

public function render($html = TRUE);
{
    if ($html)
        $this->update_response_session();
}

and (eg riddle.php) like;

public function render($html = TRUE)
    parent::render($html);
    return $this->riddle;
}

and taking update_response_session() out of the controller would do the trick.
A bit ugly though. Maybe HMVC is the answer.

Note: the if ($html) above stops update_response_session() being called twice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant