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

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

Description

@nickolasgregory

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions