|
@@ 647-652 (lines=6) @@
|
| 644 |
|
} |
| 645 |
|
|
| 646 |
|
if (isset($this->server['HTTP_X_FORWARDED_PROTO'])) { |
| 647 |
|
if (strpos($this->server['HTTP_X_FORWARDED_PROTO'], ',') !== false) { |
| 648 |
|
$parts = explode(',', $this->server['HTTP_X_FORWARDED_PROTO']); |
| 649 |
|
$proto = strtolower(trim($parts[0])); |
| 650 |
|
} else { |
| 651 |
|
$proto = strtolower($this->server['HTTP_X_FORWARDED_PROTO']); |
| 652 |
|
} |
| 653 |
|
|
| 654 |
|
// Verify that the protocol is always HTTP or HTTPS |
| 655 |
|
// default to http if an invalid value is provided |
|
@@ 810-815 (lines=6) @@
|
| 807 |
|
public function getInsecureServerHost() { |
| 808 |
|
$host = 'localhost'; |
| 809 |
|
if (isset($this->server['HTTP_X_FORWARDED_HOST'])) { |
| 810 |
|
if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) { |
| 811 |
|
$parts = explode(',', $this->server['HTTP_X_FORWARDED_HOST']); |
| 812 |
|
$host = trim(current($parts)); |
| 813 |
|
} else { |
| 814 |
|
$host = $this->server['HTTP_X_FORWARDED_HOST']; |
| 815 |
|
} |
| 816 |
|
} else { |
| 817 |
|
if (isset($this->server['HTTP_HOST'])) { |
| 818 |
|
$host = $this->server['HTTP_HOST']; |