diff options
| author | 2018-09-02 13:19:58 +0200 | |
|---|---|---|
| committer | 2018-09-02 13:19:58 +0200 | |
| commit | 32d9c3b7905f4e43ffdf4bf2bf37723cfd18390c (patch) | |
| tree | c2ed9eb08533ae795b1b97718223c6bb614a18e3 /lib | |
| parent | 565e34f7bdcc35d946d10a1840f36f40c6804f62 (diff) | |
Use mb_strcut (#1996)
* Use mb_strcut
Avoid cutting in the middle of a multi-byte UTF-8 character
* Forgotten php5-*
* Typo
* Whitespace
* More mb_strcut
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/lib_install.php | 2 | ||||
| -rw-r--r-- | lib/lib_rss.php | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/lib_install.php b/lib/lib_install.php index 7305d8e28..d51a37e58 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -41,6 +41,7 @@ function checkRequirements($dbType = '') { $dom = class_exists('DOMDocument'); $xml = function_exists('xml_parser_create'); $json = function_exists('json_encode'); + $mbstring = extension_loaded('mbstring'); $data = DATA_PATH && is_writable(DATA_PATH); $cache = CACHE_PATH && is_writable(CACHE_PATH); $users = USERS_PATH && is_writable(USERS_PATH); @@ -61,6 +62,7 @@ function checkRequirements($dbType = '') { 'dom' => $dom ? 'ok' : 'ko', 'xml' => $xml ? 'ok' : 'ko', 'json' => $json ? 'ok' : 'ko', + 'mbstring' => $mbstring ? 'ok' : 'ko', 'data' => $data ? 'ok' : 'ko', 'cache' => $cache ? 'ok' : 'ko', 'users' => $users ? 'ok' : 'ko', diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 5f460862e..60616b3ca 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -21,6 +21,12 @@ if (!function_exists('json_encode')) { defined('JSON_UNESCAPED_UNICODE') or define('JSON_UNESCAPED_UNICODE', 256); //PHP 5.3 +if (!function_exists('mb_strcut')) { + function mb_strcut($str, $start, $length = null, $encoding = 'UTF-8') { + return substr($str, $start, $length); + } +} + /** * Build a directory path by concatenating a list of directory names. * @@ -405,6 +411,7 @@ function check_install_php() { 'fileinfo' => extension_loaded('fileinfo'), 'dom' => class_exists('DOMDocument'), 'json' => extension_loaded('json'), + 'mbstring' => extension_loaded('mbstring'), 'zip' => extension_loaded('zip'), ); } |
