diff options
author | Luke Bratch <luke@bratch.co.uk> | 2015-11-22 21:31:20 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2015-11-22 21:31:20 +0000 |
commit | d0de376dd93c4f8d308f023e6a388628b755b9d8 (patch) | |
tree | 808f80c2e59dce79fa48a5ddbe39c681311a9017 /upload_file.php | |
parent | 0ae7bd19f00a8737b8f212e7b6b47f0f5adf8a16 (diff) |
Respect HTTPS or not on the upload outcome page too
Diffstat (limited to 'upload_file.php')
-rw-r--r-- | upload_file.php | 7 |
1 files changed, 7 insertions, 0 deletions
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) { |