Permalink
Browse files

fix(i18n): avoids using mbstring.internal_encoding in PHP >= 5.6

PHP 5.6 deprecates mbstring.internal_encoding, in favor of
default_encoding, which is UTF-8 by default.

Fixes #9031
  • Loading branch information...
mrclay committed Oct 14, 2015
1 parent 4cfa503 commit c0ff79de100cc8e48fd69d01883c946669b5b275
Showing with 4 additions and 2 deletions.
  1. +4 −2 engine/lib/mb_wrapper.php
@@ -234,8 +234,10 @@ function elgg_substr() {
// if mb functions are available, set internal encoding to UTF8
if (is_callable('mb_internal_encoding')) {
mb_internal_encoding("UTF-8");
- if (ini_get("mbstring.internal_encoding")) {
- ini_set("mbstring.internal_encoding", 'UTF-8');
+ if (version_compare('5.6.0', PHP_VERSION, '<')) {
+ if (ini_get("mbstring.internal_encoding")) {
+ ini_set("mbstring.internal_encoding", 'UTF-8');
+ }
}
}
};

0 comments on commit c0ff79d

Please sign in to comment.