1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Won't Fix Inconsistent usage of explicit default value in XenForo_Input

Discussion in 'Resolved Bug Reports' started by Shadab, Dec 19, 2010.

  1. Shadab

    Shadab Well-Known Member

    If I understand correctly, the "default" value is used when the input data is not of the expected data type or cannot be coerced into the expected data type. And the default value of numeric data types is zero, unless explicitly specified in the "Filter Options" array.

    Here's a quick test I did, using the XenForo_Input::UINT filter...


    The values highlighted should be 16 (passed explicitly using the filter options) instead of 0.
    This is the same behavior with all the numeric data types:
    • XenForo_Input::NUM
    • XenForo_Input::UNUM
    • XenForo_Input::INT
    • XenForo_Input::UINT
    • XenForo_Input::FLOAT
  2. Mike

    Mike XenForo Developer Staff Member

    The primary use of the default value is if the value isn't provided in the output. I'm not exactly keen on changing this for cases where incorrectly formatted values are passed - right now it just does the simplest thing: casts to the correct type.

Share This Page