diff --git a/snappymail/v/0.0.0/include.php b/snappymail/v/0.0.0/include.php index 48aff66ad..661635d40 100644 --- a/snappymail/v/0.0.0/include.php +++ b/snappymail/v/0.0.0/include.php @@ -4,24 +4,8 @@ if (defined('APP_VERSION_ROOT_PATH')) { } // PHP 8 -if (!function_exists('str_contains')) { - function str_contains(string $haystack, string $needle) : bool - { - return false !== strpos($haystack, $needle); - } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(string $haystack, string $needle) : bool - { - return 0 === strncmp($haystack, $needle, strlen($needle)); - } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(string $haystack, string $needle) : bool - { - $length = strlen($needle); - return $length ? substr($haystack, -$length) === $needle : true; - } +if (\PHP_VERSION_ID < 80000) { + require __DIR__ . '/php8.php'; } if (!defined('APP_VERSION')) { diff --git a/snappymail/v/0.0.0/php8.php b/snappymail/v/0.0.0/php8.php new file mode 100644 index 000000000..82187567c --- /dev/null +++ b/snappymail/v/0.0.0/php8.php @@ -0,0 +1,29 @@ +