Add mbstring polyfill for Plesk PHP without mbstring extension
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
6
api.php
6
api.php
@@ -18,6 +18,12 @@ set_exception_handler(function($e) {
|
|||||||
define('ADMIN_PASSWORD', 'passus');
|
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/');
|
define('DATA_DIR', __DIR__ . '/data/');
|
||||||
|
|
||||||
if (!is_dir(DATA_DIR)) mkdir(DATA_DIR, 0755, true);
|
if (!is_dir(DATA_DIR)) mkdir(DATA_DIR, 0755, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user