MDL-73586 mustache.php: Removed php init param for php80 and up
The 'mbstring.func_overload' php init setting was removed for php80 (it was deprecated since php72). So it won't evaluate to true ever, so the whole block can be put under php version condition. Note that this is already fixed upsteam, for commit: https://github.com/bobthecow/mustache.php/commit/e7165a33b282ab4d20b3863825caadb46313d62b And it has been released with version 2.14.1 of the library, so, once we upgrade to it, the fix will be incorporated.
This commit is contained in:
@@ -20,3 +20,6 @@ from the list. If still not available upstream, they will need to be re-applied.
|
||||
|
||||
- MDL-67114: PHP 7.4 compatibility. Array operations on scalar value.
|
||||
This corresponds to upstream https://github.com/bobthecow/mustache.php/pull/352
|
||||
- MDL-73586: PHP 8.0 compatibility. Removed 'mbstring.func_overload' init setting.
|
||||
This corresponds to upstream commit https://github.com/bobthecow/mustache.php/commit/e7165a33b282ab4d20b3863825caadb46313d62b
|
||||
that is availbale for the library versions 2.14.1 and up
|
||||
|
||||
@@ -97,11 +97,16 @@ class Mustache_Tokenizer
|
||||
// Setting mbstring.func_overload makes things *really* slow.
|
||||
// Let's do everyone a favor and scan this string as ASCII instead.
|
||||
//
|
||||
// The INI directive was removed in PHP 8.0 so we don't need to check there (and can drop it
|
||||
// when we remove support for older versions of PHP).
|
||||
//
|
||||
// @codeCoverageIgnoreStart
|
||||
$encoding = null;
|
||||
if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) {
|
||||
$encoding = mb_internal_encoding();
|
||||
mb_internal_encoding('ASCII');
|
||||
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
|
||||
if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) {
|
||||
$encoding = mb_internal_encoding();
|
||||
mb_internal_encoding('ASCII');
|
||||
}
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user