diff options
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) { |