From d8084c132ec411381519fe9dba2d235148692da4 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Tue, 5 Feb 2013 15:43:12 +0100 Subject: [PATCH 1/2] new function \OC_Util::runningOnWindows() --- lib/util.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/util.php b/lib/util.php index 363e3f105c0..c5ef4e3b6f4 100755 --- a/lib/util.php +++ b/lib/util.php @@ -677,4 +677,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"); + } + } From ac11c842e67fe278c4b2178623ad63a5066fc898 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Tue, 5 Feb 2013 15:46:55 +0100 Subject: [PATCH 2/2] setlocale test is pointless on Windows --- lib/util.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/util.php b/lib/util.php index c5ef4e3b6f4..4932be2d6cc 100755 --- a/lib/util.php +++ b/lib/util.php @@ -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);