Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPress/Sniffs/Security/EscapeOutputSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public function process_matched_token( $stackPtr, $group_name, $matched_content

if ( false !== $file_param ) {
// Check for a particular code pattern which can safely be ignored.
if ( preg_match( '`^[\\\\]?basename\s*\(\s*__FILE__\s*\)$`', $file_param['clean'] ) === 1 ) {
if ( preg_match( '`^[\\\\]?basename\s*\(\s*__FILE__\s*\)$`i', $file_param['clean'] ) === 1 ) {
unset( $params[1], $params['file'] ); // Remove the param, whether passed positionally or named.
}
}
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Tests/Security/EscapeOutputUnitTest.1.inc
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ $obj = new User_Error( $foo ); // OK.

// Make sure special casing of select functions is handled case-insensitively.
Trigger_ERROR( 'This is fine', $second_param_should_be_ignored ); // OK.
_Deprecated_File( basename( __FILE__ ), '1.3.0' ); // OK.
_Deprecated_File( BASENAME( __file__ ), '1.3.0' ); // OK.
_EX( 'all_params_should_be_ignored_if_function_is_reported_as_unsafe', 'another_param' ); // Bad x 1 for unsafe function.

// Allow for comments in the $file parameter.
Expand Down
Loading