diff options
| author | 2018-09-02 13:19:58 +0200 | |
|---|---|---|
| committer | 2018-09-02 13:19:58 +0200 | |
| commit | 32d9c3b7905f4e43ffdf4bf2bf37723cfd18390c (patch) | |
| tree | c2ed9eb08533ae795b1b97718223c6bb614a18e3 /lib/lib_rss.php | |
| 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/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 7 |
1 files changed, 7 insertions, 0 deletions
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'), ); } |
