diff --git a/Classes/PHPExcel/Shared/OLE/PPS/Root.php b/Classes/PHPExcel/Shared/OLE/PPS/Root.php index d06b14f2..532e652f 100644 --- a/Classes/PHPExcel/Shared/OLE/PPS/Root.php +++ b/Classes/PHPExcel/Shared/OLE/PPS/Root.php @@ -34,7 +34,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS * Directory for temporary files * @var string */ - protected $_tmp_dir = ''; + protected $_tmp_dir = NULL; /** * @param integer $time_1st A timestamp @@ -79,6 +79,8 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS if (is_resource($filename)) { $this->_FILEH_ = $filename; } else if ($filename == '-' || $filename == '') { + if (is_null($this->_tmp_dir)) + $this->_tmp_dir = PHPExcel_Shared_File::sys_get_temp_dir(); $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root"); $this->_FILEH_ = fopen($this->_tmp_filename,"w+b"); if ($this->_FILEH_ == false) { diff --git a/Classes/PHPExcel/Shared/XMLWriter.php b/Classes/PHPExcel/Shared/XMLWriter.php index cc955d7e..c7dfeb56 100644 --- a/Classes/PHPExcel/Shared/XMLWriter.php +++ b/Classes/PHPExcel/Shared/XMLWriter.php @@ -59,12 +59,14 @@ class PHPExcel_Shared_XMLWriter extends XMLWriter { * @param int $pTemporaryStorage Temporary storage location * @param string $pTemporaryStorageFolder Temporary storage folder */ - public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = './') { + public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = NULL) { // Open temporary storage if ($pTemporaryStorage == self::STORAGE_MEMORY) { $this->openMemory(); } else { // Create temporary filename + if (is_null($pTemporaryStorageFolder)) + $pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir(); $this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml'); // Open storage