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