Skip to content

Dev: using filter_* functions instead direct access to global variables #4968

@WinterSilence

Description

@WinterSilence

Example:

$_GET['foo'] = 1;
var_export($_GET); // ['foo' => 1]
var_export(filter_input_array(INPUT_GET)); // []

As you can see filter_input_array() return initial data, it's better use in CI because users (or vendor packages) can change globals before calling CI methods.

If there are no objections, then I will replace direct access to global variables everywhere. I will write sniff to fix this problem in future too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changePull requests that may break existing functionalitiesdevwaiting for infoIssues or pull requests that need further clarification from the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions