VaultPress false positive
-
A false positive occurs in VaultPress.
FILE: /public_html/wp-content/plugins/vaultpress/class.vaultpress-hotfixes.php
————————————————————————————————————————–
FOUND 1 ERROR AFFECTING 1 LINE
————————————————————————————————————————–
1083 | ERROR | Using ‘break’ outside of a loop or switch structure is invalid and will throw a fatal error since PHP 7.0
————————————————————————————————————————–Here’s the code…
foreach ( (array) $allowed_protocols as $one_protocol ) if ( strtolower($one_protocol) == $string2 ) { $allowed = true; break; }
As you can see the break applies to the foreach. I suspect the checker has parsed this incorrectly because the foreach only contains one if statement, and therefore has not enclosed it in curly brackets.
I’m choosing to ignore the error, but wanted to let people know that it can be ignored, and to advise you that you might want to adjust how your checker looks at code such as this with break.
- The topic ‘VaultPress false positive’ is closed to new replies.