Skip to content
Snippets Groups Projects
Commit 9136e6ad authored by Vincent Petry's avatar Vincent Petry
Browse files

Fixed X-Forwarded-Host parsing

parent c7e204bd
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,8 @@ class OC_Request {
$host = null;
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
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 {
$host = $_SERVER['HTTP_X_FORWARDED_HOST'];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment