Skip to content

Commit

Permalink
find more cases (0 == ""), (0 == '0foo')
Browse files Browse the repository at this point in the history
  • Loading branch information
orklah committed Jan 12, 2021
1 parent 71db6d0 commit 770b9b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/InsaneComparisonAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static function afterExpressionAnalysis(
$eligible_string = null;
foreach ($string_operand->getAtomicTypes() as $possibly_string) {
if ($possibly_string instanceof TLiteralString) {
if(preg_match('#\D#', $possibly_string->value[0] ?? '')) {
if(!is_numeric($possibly_string->value)) {
$eligible_string = $possibly_string;
break;
}
Expand Down

0 comments on commit 770b9b5

Please sign in to comment.