33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2025-02-14 07:10:21 +00:00

add support of "use function" in JEXEC rule

This commit is contained in:
Denis Ryabov 2025-02-10 15:00:07 +04:00
parent c897c6fd17
commit 109bffc1f9

View File

@ -153,7 +153,7 @@ class JedcheckerRulesJexec extends JEDcheckerRule
. '<\?php\s+' // there is an opening php tag
. '(?:declare ?\(strict_types ?= ?1 ?\) ?; ?)?' // optionally followed by declare(strict_types=1) directive
. '(?:namespace [0-9A-Za-z_\\\\]+ ?; ?)?' // optionally followed by namespace directive
. '(?:use [0-9A-Za-z_\\\\]+ ?(?:as [0-9A-Za-z_]+ ?)?; ?)*' // optionally followed by use directives
. '(?:use (?:function )?[0-9A-Za-z_\\\\]+ ?(?:as [0-9A-Za-z_]+ ?)?; ?)*' // optionally followed by use directives
. '\\\\?defined ?\( ?' // followed by defined test
. '([\'"])(?:' . implode('|', $defines) . ')\1' // of any of given constant
. ' ?\) ?(?:or |\|\| ?)(?:die|exit)\b' // or exit