parse icon indicating copy to clipboard operation
parse copied to clipboard

False positive for "LogicalOperators" rule

Open aik099 opened this issue 9 years ago • 1 comments

The common way of dealing with accessing PHP files directly from web browser (when codebase is located within DocumentRoot, like in WordPress) is placing following code on top of PHP file:

defined('FULL_PATH') or die('restricted access!');

Name of the constant is different for each framework, but construct stays the same (more or less).

I think, that this should be added as exclusion to LogicalOperators rule, because right now I'm getting following error in every PHP file:

1) core/units/related_searches/related_searches_config.php on line 15
Avoid using AND, OR and XOR (in favor of || and &&) as they may cause subtle precedence bugs
> defined('FULL_PATH') or die('restricted access!');
For more information execute 'psecio-parse rules LogicalOperators'

aik099 avatar Aug 07 '16 17:08 aik099

Yeah, this rule should probably check to see if it's in an evaluation like an if or while rather than just looking for the operator.

enygma avatar Jun 11 '18 18:06 enygma