summaryrefslogtreecommitdiff
path: root/includes/file.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-05-18 05:17:11 +0000
committerDries Buytaert <dries@buytaert.net>2005-05-18 05:17:11 +0000
commitc3cf0622b62f2e72364417becf141316f069a9c5 (patch)
tree5202ab53af2e865953dc13e990a62cd0b1fbb741 /includes/file.inc
parentfa2469c1dd3eb60f97a1824e0a37c65f83f3e332 (diff)
downloadbrdo-c3cf0622b62f2e72364417becf141316f069a9c5.tar.gz
brdo-c3cf0622b62f2e72364417becf141316f069a9c5.tar.bz2
- Patch by Drumm: one more attempt at fixing file_create_path().
Diffstat (limited to 'includes/file.inc')
-rw-r--r--includes/file.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc
index c62334154..090eb788c 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -54,10 +54,14 @@ function file_create_path($dest = 0) {
if (!$dest) {
return $file_path;
}
- // file_check_location() checks whether the destination is inside the Drupal /files directory.
+ // file_check_location() checks whether the destination is inside the Drupal files directory.
if (file_check_location($dest, $file_path)) {
return $dest;
}
+ // check if the destination is instead inside the Drupal temporary files directory.
+ else if (file_check_location($dest, variable_get('file_directory_temp', FILE_DIRECTORY_TEMP))) {
+ return $dest;
+ }
// Not found, try again with prefixed dirctory path.
else if (file_check_location($file_path . '/' . $dest, $file_path)) {
return $file_path . '/' . $dest;