From 44de6ef76df20d778508dbbb1c820ab0e636a823 Mon Sep 17 00:00:00 2001 From: Jukka Lampikoski Date: Sun, 8 Mar 2026 12:34:48 +0200 Subject: [PATCH] Add mbstring polyfill for Plesk PHP without mbstring extension Co-Authored-By: Claude Opus 4.6 --- api.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api.php b/api.php index e8892c5..0795a86 100644 --- a/api.php +++ b/api.php @@ -18,6 +18,12 @@ set_exception_handler(function($e) { define('ADMIN_PASSWORD', 'passus'); // ──────────────────────────────────────────────────────────────── +// mbstring polyfill if extension is not loaded +if (!function_exists('mb_strlen')) { + function mb_strlen($s) { return strlen($s); } + function mb_strtolower($s) { return strtolower($s); } +} + define('DATA_DIR', __DIR__ . '/data/'); if (!is_dir(DATA_DIR)) mkdir(DATA_DIR, 0755, true);