Merge pull request #1469 from owncloud/no-setlocale-on-windows

No setlocale on windows
This commit is contained in:
Bart Visscher 2013-02-05 07:16:14 -08:00
commit 86f4126d2c
1 changed files with 12 additions and 0 deletions

View File

@ -519,6 +519,11 @@ class OC_Util {
* Check if the setlocal call doesn't work. This can happen if the right local packages are not available on the server.
*/
public static function issetlocaleworking() {
// setlocale test is pointless on Windows
if (OC_Util::runningOnWindows() ) {
return true;
}
$result=setlocale(LC_ALL, 'en_US.UTF-8');
if($result==false) {
return(false);
@ -677,4 +682,11 @@ class OC_Util {
return $data;
}
/**
* @return bool - well are we running on windows or not
*/
public static function runningOnWindows() {
return (substr(PHP_OS, 0, 3) === "WIN");
}
}