summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-10-18 15:33:00 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-10-18 15:33:00 +0000
commit5bf30f6811b240d62db6cf3623e19712c56292c8 (patch)
tree78d8ad4e28a15e615bae9b992a630521c6d2e177 /includes
parent8d291f72be48b747c4595c7bf0435ef8c50ea7b8 (diff)
downloadbrdo-5bf30f6811b240d62db6cf3623e19712c56292c8.tar.gz
brdo-5bf30f6811b240d62db6cf3623e19712c56292c8.tar.bz2
#180126 by mmoreno, drewish and scor: add realpath() call to file_save_data(), so Windows will create temporary files properly
Diffstat (limited to 'includes')
-rw-r--r--includes/file.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc
index 9a1b5efeb..51ffcc36e 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -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;