summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/includes/file.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/includes/file.inc b/core/includes/file.inc
index 017a3d6..a58e6dc 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -1220,7 +1220,9 @@ function file_directory_os_temp() {
foreach ($directories as $directory) {
if (is_dir($directory) && is_writable($directory)) {
- return $directory;
+ // Both sys_get_temp_dir() and ini_get('upload_tmp_dir') can return paths
+ // with a trailing directory separator.
+ return rtrim($directory, DIRECTORY_SEPARATOR);
}
}
return FALSE;