Browse Source

Adjust HTTPS detection

Andrea Franceschini 4 năm trước cách đây
mục cha
commit
2e0e5a8909
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      libs/utils.php

+ 2 - 3
libs/utils.php

@@ -39,9 +39,8 @@ function url_origin($s, $use_forwarded_host=false) {
     $port = $s['SERVER_PORT'];
     $port = ((!$ssl && $port=='80') || ($ssl && $port=='443')) ? '' : ':'.$port;
     $host = ($use_forwarded_host && isset($s['HTTP_X_FORWARDED_HOST'])) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME']);
-    return $protocol . '://' . $host . $port;
+    return $protocol . '://' . $host;
 }
-function full_url($s, $use_forwarded_host=false)
-{
+function full_url($s, $use_forwarded_host=false) {
     return url_origin($s, $use_forwarded_host) . $s['REQUEST_URI'];
 }