From 5c5f21987ca8cfe78554d7aba37c7c0d9a059cc8 Mon Sep 17 00:00:00 2001 From: Linty Date: Mon, 1 Dec 2025 12:46:05 +0100 Subject: [PATCH] (cp 32d3ea93f) fixes #2458 add polyfill for str_starts_with function Introduces a compatibility implementation of str_starts_with for environments where it is not available. Updates common.inc.php to include the polyfill if the function does not exist. --- include/common.inc.php | 3 ++- include/php_compat/str_starts_with.php | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 include/php_compat/str_starts_with.php diff --git a/include/common.inc.php b/include/common.inc.php index 78ae39dcd..70d465d08 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -66,7 +66,8 @@ $filter = array(); foreach( array( - 'gzopen' + 'gzopen', + 'str_starts_with' ) as $func) { if (!function_exists($func)) diff --git a/include/php_compat/str_starts_with.php b/include/php_compat/str_starts_with.php new file mode 100644 index 000000000..4fe793749 --- /dev/null +++ b/include/php_compat/str_starts_with.php @@ -0,0 +1,8 @@ +