From 32d3ea93f8052d28857b8523f8d4de3cd49583fd Mon Sep 17 00:00:00 2001 From: Linty Date: Mon, 1 Dec 2025 12:43:46 +0100 Subject: [PATCH] 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 @@ +