From 4c99f81e402d5c3e86978c7e5a846a18f2511022 Mon Sep 17 00:00:00 2001 From: Lorenzo Yario Date: Sun, 7 Apr 2024 06:00:43 -0700 Subject: [PATCH] remove outdated code for unsupported mysql version --- post.php | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/post.php b/post.php index 923828c0..1ff746c5 100644 --- a/post.php +++ b/post.php @@ -39,33 +39,6 @@ function md5_hash_of_file($config, $path) { } } -/** - * Strip the symbols incompatible with the current database version. - * - * @param string @input The input string. - * @return string The value stripped of incompatible symbols. - */ -function strip_symbols($input) { - if (mysql_version() >= 50503) { - return $input; // Assume we're using the utf8mb4 charset - } else { - // MySQL's `utf8` charset only supports up to 3-byte symbols - // Remove anything >= 0x010000 - - $chars = preg_split('//u', $input, -1, PREG_SPLIT_NO_EMPTY); - $ret = ''; - foreach ($chars as $char) { - $o = 0; - $ord = ordutf8($char, $o); - if ($ord >= 0x010000) { - continue; - } - $ret .= $char; - } - return $ret; - } -} - /** * Download a remote file from the given url. * The file is deleted at shutdown.