phpinspectionsea icon indicating copy to clipboard operation
phpinspectionsea copied to clipboard

Substring comparison flaws with hex characters

Open Stevehans opened this issue 1 year ago • 0 comments

Subject Details
Plugin Php Inspections (EA Ultimate), 2023.1
Language level e.g. PHP 7.3

Current behaviour

if(substr($fileContents,0,3) === "\xff\xd8\xff")

Reports that the length doesn't match

Expected behaviour

Should not complain as the length is correct.

Stevehans avatar Nov 08 '23 16:11 Stevehans