From e01bf82245477dc54abf644b246e34ebe7d22cc5 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Mon, 23 Feb 2026 15:15:14 -0300 Subject: [PATCH] PHP/RestrictedPHPFunctions: update error message to focus on security risk Remove the reference to create_function() being deprecated/removed from PHP, as that is PHPCompatibility's domain, and instead focus on the security risk it poses. --- WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php b/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php index f3102e33d5..8e0754b21c 100644 --- a/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php +++ b/WordPress/Sniffs/PHP/RestrictedPHPFunctionsSniff.php @@ -35,7 +35,7 @@ public function getGroups() { return array( 'create_function' => array( 'type' => 'error', - 'message' => '%s() is deprecated as of PHP 7.2 and removed in PHP 8.0. Please use declared named or anonymous functions instead.', + 'message' => '%s() must not be used as it can pose a security risk. Use a declared function or an anonymous function (closure) instead.', 'functions' => array( 'create_function', ),