mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Merge pull request #481 from pi-hole/fix/unauthorized-access-to-teleporter
Temporarily store the teleporter file
This commit is contained in:
@@ -148,7 +148,7 @@ if(isset($_POST["action"]))
|
||||
else
|
||||
{
|
||||
$filename = "pi-hole-teleporter_".date("Y-m-d_h-i-s").".zip";
|
||||
$archive_file_name = "/var/www/html/".$filename;
|
||||
$archive_file_name = tempnam("/tmp", "Teleporter");
|
||||
$zip = new ZipArchive();
|
||||
touch($archive_file_name);
|
||||
$res = $zip->open($archive_file_name, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
@@ -174,6 +174,8 @@ else
|
||||
header("Expires: 0");
|
||||
if(ob_get_length() > 0) ob_end_clean();
|
||||
readfile($archive_file_name);
|
||||
ignore_user_abort(true);
|
||||
unlink($archive_file_name);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user