From 382ccdb499f44e2d076274432a2f976c8d2c6d97 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 4 Mar 2024 19:46:12 +0100 Subject: [PATCH] Polyfill ctype #1250 --- .../v/0.0.0/app/libraries/polyfill/ctype.php | 17 +++++++++++++++++ .../app/libraries/snappymail/integrity.php | 1 - snappymail/v/0.0.0/include.php | 6 +++++- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 snappymail/v/0.0.0/app/libraries/polyfill/ctype.php diff --git a/snappymail/v/0.0.0/app/libraries/polyfill/ctype.php b/snappymail/v/0.0.0/app/libraries/polyfill/ctype.php new file mode 100644 index 000000000..7f913e728 --- /dev/null +++ b/snappymail/v/0.0.0/app/libraries/polyfill/ctype.php @@ -0,0 +1,17 @@ + extension_loaded('mbstring'), 'Zlib' => extension_loaded('zlib'), // enabled by default: - 'ctype' => extension_loaded('ctype'), 'json' => function_exists('json_decode'), 'libxml' => function_exists('libxml_use_internal_errors'), 'dom' => class_exists('DOMDocument'), diff --git a/snappymail/v/0.0.0/include.php b/snappymail/v/0.0.0/include.php index 6c770f7c5..eb32c8bcc 100644 --- a/snappymail/v/0.0.0/include.php +++ b/snappymail/v/0.0.0/include.php @@ -4,10 +4,14 @@ if (defined('APP_VERSION_ROOT_PATH')) { } // PHP 8 -if (\PHP_VERSION_ID < 80000) { +if (PHP_VERSION_ID < 80000) { require __DIR__ . '/app/libraries/polyfill/php8.php'; } +if (!extension_loaded('ctype')) { + require __DIR__ . '/app/libraries/polyfill/ctype.php'; +} + if (!defined('APP_VERSION')) { define('APP_VERSION', basename(__DIR__)); }