Prevent leaving an orphaned file while importing preferences

Fix #12362

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
This commit is contained in:
Deven Bansod 2016-10-05 11:33:44 +05:30
parent a7786dd93a
commit 889cd31618

View File

@ -62,9 +62,9 @@ if (isset($_POST['submit_export'])
$tmp_subdir = (PMA_IS_WINDOWS ? '.\\tmp\\' : 'tmp/');
if (@is_writable($tmp_subdir)) {
$import_file_new = tempnam($tmp_subdir, 'prefs');
$file_to_unlink = $import_file_new;
if (move_uploaded_file($import_file, $import_file_new)) {
$import_file = $import_file_new;
$file_to_unlink = $import_file_new;
}
}
}