Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions SpreadsheetReader_XLSX.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,6 @@ public function __construct($Filepath, array $Options = null)
*/
public function __destruct()
{
foreach ($this -> TempFiles as $TempFile)
{
@unlink($TempFile);
}

// Better safe than sorry - shouldn't try deleting '.' or '/', or '..'.
if (strlen($this -> TempDir) > 2)
{
@rmdir($this -> TempDir.'xl'.DIRECTORY_SEPARATOR.'worksheets');
@rmdir($this -> TempDir.'xl');
@rmdir($this -> TempDir);
}

if ($this -> Worksheet && $this -> Worksheet instanceof XMLReader)
{
$this -> Worksheet -> close();
Expand All @@ -356,6 +343,19 @@ public function __destruct()
{
unset($this -> WorkbookXML);
}

foreach ($this -> TempFiles as $TempFile)
{
@unlink($TempFile);
}

// Better safe than sorry - shouldn't try deleting '.' or '/', or '..'.
if (strlen($this -> TempDir) > 2)
{
@rmdir($this -> TempDir.'xl'.DIRECTORY_SEPARATOR.'worksheets');
@rmdir($this -> TempDir.'xl');
@rmdir($this -> TempDir);
}
}

/**
Expand Down