Fixed X-Forwarded-Host parsing
This commit is contained in:
parent
c7e204bd36
commit
9136e6ad30
|
@ -58,7 +58,8 @@ class OC_Request {
|
||||||
$host = null;
|
$host = null;
|
||||||
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
|
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
|
||||||
if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ",") !== false) {
|
if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ",") !== false) {
|
||||||
$host = trim(array_pop(explode(",", $_SERVER['HTTP_X_FORWARDED_HOST'])));
|
$parts = explode(',', $_SERVER['HTTP_X_FORWARDED_HOST']);
|
||||||
|
$host = trim(current($parts));
|
||||||
} else {
|
} else {
|
||||||
$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
|
$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue