diff --git a/administrator/components/com_jedchecker/libraries/rules/framework.php b/administrator/components/com_jedchecker/libraries/rules/framework.php index 9cd294d..6f9edb2 100644 --- a/administrator/components/com_jedchecker/libraries/rules/framework.php +++ b/administrator/components/com_jedchecker/libraries/rules/framework.php @@ -257,14 +257,16 @@ class JedcheckerRulesFramework extends JEDcheckerRule { $regex = preg_quote($singleTest, '/'); + // Add word boundary check for rules staring/ending with a letter (to avoid false-positives because of partial match) + if (ctype_alpha($singleTest[0])) { - $regex = '(?<=\W|^)' . $regex; + $regex = '\b' . $regex; } if (ctype_alpha($singleTest[strlen($singleTest) - 1])) { - $regex .= '(?=\W|$)'; + $regex .= '\b'; } if (preg_match('/' . $regex . '/i', $line))