Skip to content

Commit d73d7f4

Browse files
committed
Refactor getFullUrl method and increase version number.
1 parent cffd259 commit d73d7f4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

server/php/upload.class.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* jQuery File Upload Plugin PHP Class 5.11
3+
* jQuery File Upload Plugin PHP Class 5.11.1
44
* https://github.com/blueimp/jQuery-File-Upload
55
*
66
* Copyright 2010, Sebastian Tschan
@@ -66,11 +66,12 @@ function __construct($options=null) {
6666
}
6767

6868
protected function getFullUrl() {
69+
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
6970
return
70-
((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://').
71-
(isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
71+
($https ? 'https://' : 'http://').
72+
(!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
7273
(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].
73-
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' && $_SERVER['SERVER_PORT'] === 443 ||
74+
($https && $_SERVER['SERVER_PORT'] === 443 ||
7475
$_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).
7576
substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
7677
}

0 commit comments

Comments
 (0)