Skip to content

Commit

Permalink
Refactor getFullUrl method and increase version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed May 22, 2012
1 parent cffd259 commit d73d7f4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/php/upload.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* jQuery File Upload Plugin PHP Class 5.11
* jQuery File Upload Plugin PHP Class 5.11.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
Expand Down Expand Up @@ -66,11 +66,12 @@ function __construct($options=null) {
}

protected function getFullUrl() {
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
return
((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://').
(isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
($https ? 'https://' : 'http://').
(!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' && $_SERVER['SERVER_PORT'] === 443 ||
($https && $_SERVER['SERVER_PORT'] === 443 ||
$_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).
substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
}
Expand Down

0 comments on commit d73d7f4

Please sign in to comment.