aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/tempmanager.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-15 13:29:57 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-15 13:29:57 +0100
commit41106c1967cb7cbee20dd56666d9605eabdc4460 (patch)
treea7095c7ab468c7af9d1bc4ddde08c28e1dec32cb /lib/private/tempmanager.php
parent13ce6d0f1cb8eb6eb480685588040cc010a515c6 (diff)
parent3a5087ccdff79012a6c14adb63dbaa2e61607f2d (diff)
downloadnextcloud-server-41106c1967cb7cbee20dd56666d9605eabdc4460.tar.gz
nextcloud-server-41106c1967cb7cbee20dd56666d9605eabdc4460.zip
Merge pull request #21543 from owncloud/Larzenegger-master
[CI] Larzenegger master
Diffstat (limited to 'lib/private/tempmanager.php')
-rw-r--r--lib/private/tempmanager.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/private/tempmanager.php b/lib/private/tempmanager.php
index 378da91e226..19bbaf6e78e 100644
--- a/lib/private/tempmanager.php
+++ b/lib/private/tempmanager.php
@@ -225,11 +225,6 @@ class TempManager implements ITempManager {
if ($temp = getenv('TMPDIR')) {
$directories[] = $temp;
}
- $temp = tempnam(__FILE__, '');
- if (file_exists($temp)) {
- unlink($temp);
- $directories[] = dirname($temp);
- }
if ($temp = sys_get_temp_dir()) {
$directories[] = $temp;
}
@@ -239,6 +234,12 @@ class TempManager implements ITempManager {
return $dir;
}
}
+
+ $temp = tempnam(dirname(__FILE__), '');
+ if (file_exists($temp)) {
+ unlink($temp);
+ return dirname($temp);
+ }
throw new \UnexpectedValueException('Unable to detect system temporary directory');
}