Commit 5bf30f68 authored by Gábor Hojtsy's avatar Gábor Hojtsy

#180126 by mmoreno, drewish and scor: add realpath() call to file_save_data(),...

#180126 by mmoreno, drewish and scor: add realpath() call to file_save_data(), so Windows will create temporary files properly
parent 8d291f72
......@@ -750,7 +750,8 @@ function file_validate_image_resolution(&$file, $maximum_dimensions = 0, $minimu
*/
function file_save_data($data, $dest, $replace = FILE_EXISTS_RENAME) {
$temp = file_directory_temp();
$file = tempnam($temp, 'file');
// On Windows, tempnam() requires an absolute path, so we use realpath().
$file = tempnam(realpath($temp), 'file');
if (!$fp = fopen($file, 'wb')) {
drupal_set_message(t('The file could not be created.'), 'error');
return 0;
......
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