diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-24 23:34:38 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-02-24 23:51:36 +0100 |
commit | 06cf93e6ee19ea5c710b029fd403af3c90529074 (patch) | |
tree | 59b7f506000c3fa14b97d3ec0f16d3f56a313b7a /lib | |
parent | 09a06e4f0a2d473e1dc3ea1d92fefc3cfa318d4d (diff) | |
download | nextcloud-server-06cf93e6ee19ea5c710b029fd403af3c90529074.tar.gz nextcloud-server-06cf93e6ee19ea5c710b029fd403af3c90529074.zip |
Move UTF-8 check to setup
Nobody reads the warnings anyways and so we should enforce it at installation time... Also allows us to get rid of some duplicated code.
To test change the `default_charset` to something other than `utf-8` or `UTF-8`, both should work fine with that change here. An error should then get shown.
We already set those default charsets in the shipped .user.ini and .htaccess
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/util.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index 8ffb9e35bad..44ddc26fc31 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -651,6 +651,7 @@ class OC_Util { 'ini' => [ 'mbstring.func_overload' => 0, 'output_buffering' => false, + 'default_charset' => 'UTF-8', ], ); $missingDependencies = array(); @@ -684,6 +685,11 @@ class OC_Util { $invalidIniSettings[] = [$setting, $expected]; } } + if(is_string($expected)) { + if(strtolower($iniWrapper->getString($setting)) !== strtolower($expected)) { + $invalidIniSettings[] = [$setting, $expected]; + } + } } foreach($missingDependencies as $missingDependency) { @@ -1511,13 +1517,4 @@ class OC_Util { } } - /** - * Check if PhpCharset config is UTF-8 - * - * @return string - */ - public static function isPhpCharSetUtf8() { - return strtoupper(ini_get('default_charset')) === 'UTF-8'; - } - } |