From b8d6550096984ea739cc496c8becaf7f31665dab Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 9 Feb 2017 16:21:21 +0100 Subject: [PATCH] Detect mime type of uploaded file on the server instead of relying on what the uploading OS tells us. Fixes #395 --- scripts/pi-hole/php/teleporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/teleporter.php b/scripts/pi-hole/php/teleporter.php index a86e3e22..7f6e76bf 100644 --- a/scripts/pi-hole/php/teleporter.php +++ b/scripts/pi-hole/php/teleporter.php @@ -63,7 +63,7 @@ if($_POST["action"] == "in") { $filename = $_FILES["zip_file"]["name"]; $source = $_FILES["zip_file"]["tmp_name"]; - $type = $_FILES["zip_file"]["type"]; + $type = mime_content_type($source); $name = explode(".", $filename); $accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');