envato / envato-theme-check

The WordPress Theme Check plugin for Envato
GNU General Public License v2.0
208 stars 57 forks source link

Allow function names ending in `echo` or `print` #36

Closed nyordanov closed 5 years ago

nyordanov commented 5 years ago

The following regex matches any function name which ends in print or echo:

https://github.com/envato/envato-theme-check/blob/9b78fcf804c41ec3943d174c7c6afdab84800838/checks/themeforest.php#L55

Please consider changing it to /[^a-zA-Z0-9_\x7f-\xff](echo|print)\s*\(?\s*\$/

The regex for matching valid PHP function names is taken from the "User-defined functions" page in the PHP documentation