Delete temporary file before reporting error

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-07-22 11:31:09 +02:00
parent e8c5cab3c1
commit 6f8eb0993d

View File

@ -148,6 +148,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 != "") {
@ -159,14 +167,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',
@ -340,4 +340,4 @@ class ImportShp extends ImportPlugin
$buffer = substr($buffer, $length);
return $result;
}
}
}