Code Monkey home page Code Monkey logo

Comments (4)

dapphp avatar dapphp commented on June 14, 2024

Admittedly, the documentation on the site is in need of an update, and the current state of things is to use the examples and code as docs (bad!). But this does seem like a fair warning.

The phpDoc comments for the check() function reads:

    /**
     * Checks a given code against the correct value from the session and/or database.
     *
     * @param string $code      The captcha code to check
     * @param string $captchaId The ID of the captcha being checked
     * @param bool   $alwaysDelete True to delete captcha data after a failed guess.
     *   Useful if the form post results in a full page reload and the old captcha
     *   ID is never used again. Not so useful on Ajax forms.  (default false)
     *
     * <code>
     *     $code = $_POST['code'];
     *     $img  = new Securimage();
     *     if ($img->check($code) == true) {
     *         $captcha_valid = true;
     *     } else {
     *         $captcha_valid = false;
     *     }
     * </code>
     *
     * @return bool true if the given code was correct, false if not.
     */

Admittedly, the 'string' parameter hint is subtle as well.

I'm not against type checking the $code parameter explicitly to prevent this warning from strtolower. Would a trigger_error to the effect of The $code parameter passed to Securimage::check() must be a string, $type given be sufficient in your opinion?

from securimage.

Vacman avatar Vacman commented on June 14, 2024

My error log is full of this error:
The $code parameter passed to Securimage::check() must be a string, NULL given in /home/xxxx/public_html/securimage/securimage.php on line 1278

from securimage.

AndyJAllen avatar AndyJAllen commented on June 14, 2024

My error log is full of this error:
The $code parameter passed to Securimage::check() must be a string, NULL given in /home/xxxx/public_html/securimage/securimage.php on line 1278

Yes I get this too.

from securimage.

alimbabazade avatar alimbabazade commented on June 14, 2024

I solved this problem. The problem is solved when I send the values sent from the form with GET instead of POST and receive them with GET.

from securimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.