Files
Piwigo/include/php_compat/str_starts_with.php
Linty 32d3ea93f8 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.
2025-12-01 12:43:46 +01:00

9 lines
196 B
PHP

<?php
if (!function_exists('str_starts_with'))
{
function str_starts_with(string $haystack, string $needle): bool
{
return strlen($needle) === 0 || strpos($haystack, $needle) === 0;
}
}