.. _security-filterinputsource: .. _filter\_input()-as-a-source: filter_input() As A Source ++++++++++++++++++++++++++ The `filter_input() `_ and `filter_input_array() `_ functions access directly to ``$_GET``. They represent a source for external data just like ``$_GET``, ``$_POST``, etc. The main feature of `filter_input() `_ is that it is already filtered. The main drawback is that ``FILTER_FLAG_NONE`` is the ``none`` filter, and that default configuration is `FILTER_UNSAFE_RAW`. The filter extension keeps access to the incoming data, even after the super globals, such as ``$_GET``, are unset. Thanks to `Frederic Bouchery `_ for reporting this `special case `_. .. code-block:: php See also `Data filtering `_. Connex PHP features ------------------- + `validation `_ Suggestions ___________ * Use the classic $_GET, $_POST super globals, which are easier to audit. * Use your framework's parameter access. Specs _____ +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Short name | Security/FilterInputSource | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`Changed Behavior `, :ref:`Security ` | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Exakat since | 1.4.8 | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | PHP Version | All | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Severity | Minor | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Time To Fix | Slow (1 hour) | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Precision | High | +--------------+-------------------------------------------------------------------------------------------------------------------------+ | Available in | `Entreprise Edition `_, `Exakat Cloud `_ | +--------------+-------------------------------------------------------------------------------------------------------------------------+