aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorHendrik Langer <hendrik.langer@gmx.de>2011-10-19 23:38:35 +0200
committerHendrik Langer <hendrik.langer@gmx.de>2011-10-19 23:38:35 +0200
commit466b41c36bf7093cdde9d2856eb520503f52640c (patch)
tree6456918f3f142f0ade1370ffb948fa9ffc59a267 /lib/base.php
parentda8d32ae38acdab576a30ca56b30579f427c780d (diff)
downloadnextcloud-server-466b41c36bf7093cdde9d2856eb520503f52640c.tar.gz
nextcloud-server-466b41c36bf7093cdde9d2856eb520503f52640c.zip
Don't use sys_get_temp_dir(), as it reports the wrong path in restricted environments
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/base.php b/lib/base.php
index 8adb1cc9102..d5fff1e0a74 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -186,18 +186,19 @@ if( !isset( $RUNTIME_NOAPPS )){
OC::init();
-if(!function_exists('sys_get_temp_dir')) {
- function sys_get_temp_dir() {
- if( $temp=getenv('TMP') ) return $temp;
- if( $temp=getenv('TEMP') ) return $temp;
- if( $temp=getenv('TMPDIR') ) return $temp;
- $temp=tempnam(__FILE__,'');
- if (file_exists($temp)) {
- unlink($temp);
- return dirname($temp);
- }
- return null;
- }
+if(!function_exists('get_temp_dir')) {
+ function get_temp_dir() {
+ if( $temp=ini_get('upload_tmp_dir') ) return $temp;
+ if( $temp=getenv('TMP') ) return $temp;
+ if( $temp=getenv('TEMP') ) return $temp;
+ if( $temp=getenv('TMPDIR') ) return $temp;
+ $temp=tempnam(__FILE__,'');
+ if (file_exists($temp)) {
+ unlink($temp);
+ return dirname($temp);
+ }
+ return null;
+ }
}
require_once('fakedirstream.php');