If the user already appended the file extension, don't add it again

This commit is contained in:
lorilee
2010-07-12 19:10:11 -07:00
parent 22254ba748
commit 5b8c603124

View File

@@ -281,7 +281,13 @@ if ($asfile) {
}
// Grab basic dump extension and mime type
$filename .= '.' . $export_list[$type]['extension'];
// Check if the user already added extension; get the substring where the extension would be if it was included
$extension_start_pos = strlen($filename) - strlen($export_list[$type]['extension']) - 1;
$user_extension = substr($filename, $extension_start_pos, strlen($filename));
$required_extension = "." . $export_list[$type]['extension'];
if(strtolower($user_extension) != $required_extension) {
$filename .= $required_extension;
}
$mime_type = $export_list[$type]['mime_type'];
// If dump is going to be compressed, set correct mime_type and add