summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2015-11-22 21:31:20 +0000
committerLuke Bratch <luke@bratch.co.uk>2015-11-22 21:31:20 +0000
commitd0de376dd93c4f8d308f023e6a388628b755b9d8 (patch)
tree808f80c2e59dce79fa48a5ddbe39c681311a9017
parent0ae7bd19f00a8737b8f212e7b6b47f0f5adf8a16 (diff)
Respect HTTPS or not on the upload outcome page too
-rw-r--r--upload_file.php7
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)
{