| @@ 44-57 (lines=14) @@ | ||
| 41 | * |
|
| 42 | * @return string |
|
| 43 | */ |
|
| 44 | public static function current() |
|
| 45 | { |
|
| 46 | $protocol = (!empty($_SERVER['HTTPS']) |
|
| 47 | && $_SERVER['HTTPS'] !== 'off' |
|
| 48 | || $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://'; |
|
| 49 | ||
| 50 | if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { |
|
| 51 | $host = $_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 52 | } else { |
|
| 53 | $host = $_SERVER['HTTP_HOST']; |
|
| 54 | } |
|
| 55 | ||
| 56 | return $protocol . $host . $_SERVER['REQUEST_URI']; |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| @@ 21-33 (lines=13) @@ | ||
| 18 | * |
|
| 19 | * @return string |
|
| 20 | */ |
|
| 21 | public static function current() |
|
| 22 | { |
|
| 23 | $protocol = (!empty($_SERVER['HTTPS']) |
|
| 24 | && $_SERVER['HTTPS'] !== 'off' |
|
| 25 | || $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://'; |
|
| 26 | ||
| 27 | if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { |
|
| 28 | $host = $_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 29 | } else { |
|
| 30 | $host = $_SERVER['HTTP_HOST']; |
|
| 31 | } |
|
| 32 | ||
| 33 | return $protocol . $host . $_SERVER['REQUEST_URI']; |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||