From 5bf30f6811b240d62db6cf3623e19712c56292c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 18 Oct 2007 15:33:00 +0000 Subject: #180126 by mmoreno, drewish and scor: add realpath() call to file_save_data(), so Windows will create temporary files properly --- includes/file.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'includes') 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; -- cgit v1.2.3