From 48764f226073be9fb52c7b68101fb8f7b12e3d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 22 Jul 2016 11:31:09 +0200 Subject: [PATCH] Delete temporary file before reporting error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/plugins/import/ImportShp.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/plugins/import/ImportShp.php b/libraries/plugins/import/ImportShp.php index 1f9435665e..e60b36cfd9 100644 --- a/libraries/plugins/import/ImportShp.php +++ b/libraries/plugins/import/ImportShp.php @@ -130,6 +130,14 @@ class ImportShp extends ImportPlugin } } + // Delete the .dbf file extracted to 'TempDir' + if ($temp_dbf_file + && isset($dbf_file_path) + && file_exists($dbf_file_path) + ) { + unlink($dbf_file_path); + } + // Load data $shp->loadFromFile(''); if ($shp->lastError != "") { @@ -142,14 +150,6 @@ class ImportShp extends ImportPlugin return; } - // Delete the .dbf file extracted to 'TempDir' - if ($temp_dbf_file - && isset($dbf_file_path) - && file_exists($dbf_file_path) - ) { - unlink($dbf_file_path); - } - $esri_types = array( 0 => 'Null Shape', 1 => 'Point',