From d0de376dd93c4f8d308f023e6a388628b755b9d8 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 22 Nov 2015 21:31:20 +0000 Subject: Respect HTTPS or not on the upload outcome page too --- upload_file.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/upload_file.php b/upload_file.php index 09f2bd7..a1b218e 100644 --- a/upload_file.php +++ b/upload_file.php @@ -33,6 +33,13 @@ function size_readable($size, $max = null, $system = 'si', $retstring = '%01.2f return sprintf($retstring, $size, $sys['prefix'][$i]); } +// Respect HTTPS or not +if (isset($_SERVER['HTTPS'])) { + $url = preg_replace("/^http:\/\//", "https://", $url); +} else { + $url = preg_replace("/^https:\/\//", "http://", $url); +} + { if ($_FILES["file"]["error"] > 0) { -- cgit v1.2.3