Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Input::put() throws exception when stream is not of PUT type. Small bug?
  • I have discovered that at least in Fuel 1.6.1 if Input::put() is called when the PHP input stream is actually of type POST rather than PUT, an exception is thrown rather than the expected default return value. I believe this may be a small bug. Example line of code:
    echo Input::put( 'isVisible' ); // Run this with not PUT data submitted, only POST.


    An exception is thrown:
    "InvalidArgumentException [ Error ]: First parameter must be an array or ArrayAccess object."

    COREPATH/classes/arr.php @ line 38

    throw new \InvalidArgumentException('First parameter must be an array or ArrayAccess object.');

  • Update: Edited post above as I now believe this to be a small bug.  I believe the default value should still be returned rather than an unrelated exception being thrown.  Even providing a second parameter with a custom default does not work and the exception is thrown.
  • Can you create an issue for this at https://github.com/fuel/core/issues ?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion