summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-02-05 07:16:14 -0800
committerBart Visscher <bartv@thisnet.nl>2013-02-05 07:16:14 -0800
commit86f4126d2c83a4f796ece79c0eecdec854b31138 (patch)
tree5d4b9ba842cecca878a8b5b1f692213927eaecac
parent79e6e579e3e235175ec19dc8f3ab73ff125e4e83 (diff)
parentac11c842e67fe278c4b2178623ad63a5066fc898 (diff)
downloadnextcloud-server-86f4126d2c83a4f796ece79c0eecdec854b31138.tar.gz
nextcloud-server-86f4126d2c83a4f796ece79c0eecdec854b31138.zip
Merge pull request #1469 from owncloud/no-setlocale-on-windows
No setlocale on windows
-rwxr-xr-xlib/util.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 363e3f105c0..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);
@@ -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");
+ }
+
}