tchwork / utf8

Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP
Apache License 2.0
627 stars 50 forks source link

[ini_set] warning in prod #65

Closed nabbar closed 3 years ago

nabbar commented 7 years ago

Hi,

In many production environnement ini_set are forbidden for security reasons.

Could you put all ini_set into a if statement and/or throw error : https://github.com/tchwork/utf8/blob/master/src/Patchwork/Utf8/Bootup.php#L52

            if (function_exists('mb_regex_encoding')) {
                mb_regex_encoding('UTF-8');
            }
            ini_set('mbstring.script_encoding', 'pass');
            if ('utf-8' !== strtolower(mb_internal_encoding())) {
                mb_internal_encoding('UTF-8');
            }

Thanks in advance