Open
Description
Sometimes, an input is flagged as not sanitized if we trim it:
$foo = absint( $_GET['foo'] ); // OK.
$foo = absint( trim( $_GET['foo'] ) ); // InputNotSanitized.
$foo = absint( ltrim( $_GET['foo'] ) ); // InputNotSanitized.
$foo = absint( rtrim( $_GET['foo'] ) ); // InputNotSanitized.
I believe trimming should be accepted before sanitizing an input.
Maybe we could add ltrim
, rtrim
, and trim
as a trimmingFunctions
array and allow them here?
WordPress-Coding-Standards/WordPress/Sniff.php
Line 1852 in 2ac765f