diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-07-25 09:53:25 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-07-25 09:53:25 +0200 |
commit | 07dc0b2fdf827a7583e8f29bc7a2a1568e070383 (patch) | |
tree | be96e6eb268e64e8febefd7ca6f80f81f0a5f6cf | |
parent | 3f58d949e012c68a01b9d4603c32244811196939 (diff) | |
download | nextcloud-server-07dc0b2fdf827a7583e8f29bc7a2a1568e070383.tar.gz nextcloud-server-07dc0b2fdf827a7583e8f29bc7a2a1568e070383.zip |
setting and checking default_charset in php.ini to be UTF-8
-rw-r--r-- | lib/base.php | 3 | ||||
-rwxr-xr-x | lib/private/util.php | 7 | ||||
-rwxr-xr-x | settings/admin.php | 1 | ||||
-rw-r--r-- | settings/templates/admin.php | 26 |
4 files changed, 31 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php index 730cee5231d..95f6482e611 100644 --- a/lib/base.php +++ b/lib/base.php @@ -472,6 +472,9 @@ class OC { @ini_set('post_max_size', '10G'); @ini_set('file_uploads', '50'); + // setting charset to UTF8 + @ini_set('default_charset', 'UTF-8'); + self::handleAuthHeaders(); self::initPaths(); diff --git a/lib/private/util.php b/lib/private/util.php index eea194288f9..ec5b2740ae8 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1447,4 +1447,11 @@ class OC_Util { return false; } } + + /** + * @return string + */ + public static function isPhpCharSetUtf8() { + return ini_get('default_charset') === 'UTF-8'; + } } diff --git a/settings/admin.php b/settings/admin.php index 704f4519ff6..230c31f6202 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -39,6 +39,7 @@ $tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('htaccessworking', $htaccessworking); $tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false); $tmpl->assign('isLocaleWorking', OC_Util::isSetLocaleWorking()); +$tmpl->assign('isPhpCharSetUtf8', OC_Util::isPhpCharSetUtf8()); $tmpl->assign('isAnnotationsWorking', OC_Util::isAnnotationsWorking()); $tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking()); $tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 03f3efd7aae..de46cec476c 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -129,14 +129,28 @@ if (!$_['has_fileinfo']) { // is PHP at least at 5.3.8? if ($_['old_php']) { ?> -<div class="section"> - <h2><?php p($l->t('Your PHP version is outdated'));?></h2> + <div class="section"> + <h2><?php p($l->t('Your PHP version is outdated'));?></h2> <span class="connectionwarning"> <?php p($l->t('Your PHP version is outdated. We strongly recommend to update to 5.3.8 or newer because older versions are known to be broken. It is possible that this installation is not working correctly.')); ?> </span> -</div> + </div> +<?php +} + +// is PHP charset set to UTF8? +if (!$_['isPhpCharSetUtf8']) { + ?> + <div class="section"> + <h2><?php p($l->t('PHP charset is not set to UTF-8'));?></h2> + + <span class="connectionwarning"> + <?php p($l->t("PHP charset is not set to UTF-8. This can cause major issues with non-acsii characters in file names. We highly recommend to change the value of 'default_charset' php.ini to 'UTF-8'.")); ?> + </span> + + </div> <?php } @@ -168,14 +182,14 @@ if (!$_['isLocaleWorking']) { // is internet connection working ? if (!$_['internetconnectionworking']) { ?> -<div class="section"> - <h2><?php p($l->t('Internet connection not working'));?></h2> + <div class="section"> + <h2><?php p($l->t('Internet connection not working'));?></h2> <span class="connectionwarning"> <?php p($l->t('This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features.')); ?> </span> -</div> + </div> <?php } ?> |