diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2020-01-30 03:52:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 03:52:55 +0300 |
commit | ab047ab6d33072e312a81814de24258408c5cb79 (patch) | |
tree | e526a3c48caa4491141feb9a3392f5823ad4dc76 /libs | |
parent | 20d638a749f8d4e6e172e84102be61a061173741 (diff) |
Make sparklines work when mbstring extension is not installed (#15489)
1) Too few arguments to function mb_strtolower(), 1 passed in matomo/vendor/davaxi/sparkline/src/Sparkline/StyleTrait.php on line 129 and exactly 2 expected
2) mb_strlen is not defined
Diffstat (limited to 'libs')
-rw-r--r-- | libs/upgradephp/upgrade.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libs/upgradephp/upgrade.php b/libs/upgradephp/upgrade.php index 29fa9752d9..3ac2b8ae8c 100644 --- a/libs/upgradephp/upgrade.php +++ b/libs/upgradephp/upgrade.php @@ -681,9 +681,22 @@ if (!function_exists('utf8_decode')) { * @param string $charset */ if(!function_exists('mb_strtolower')) { - function mb_strtolower($input, $charset) { - return strtolower($input); - } + function mb_strtolower($input, $charset = '') { + return strtolower($input); + } +} + +/** + * Use strlen if mb_strlen doesn't exist (i.e., php not compiled with --enable-mbstring) + * This is not a functional replacement for mb_strlen. + * + * @param string $input + * @param string $charset + */ +if(!function_exists('mb_strlen')) { + function mb_strlen($input, $charset = '') { + return strlen($input); + } } /** |