Commit c3cf0622 authored by Dries's avatar Dries

- Patch by Drumm: one more attempt at fixing file_create_path().

parent fa2469c1
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment