summaryrefslogtreecommitdiffstats
path: root/lib/private/request.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-05 17:04:45 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-06 11:51:25 +0100
commit9136e6ad3028040b91685fc94e8fccd29c9b9210 (patch)
tree5b8ceb5605330524527812c41eba8d6281f9985e /lib/private/request.php
parentc7e204bd3674b616faddbb0b88187f94638e5b01 (diff)
downloadnextcloud-server-9136e6ad3028040b91685fc94e8fccd29c9b9210.tar.gz
nextcloud-server-9136e6ad3028040b91685fc94e8fccd29c9b9210.zip
Fixed X-Forwarded-Host parsing
Diffstat (limited to 'lib/private/request.php')
-rwxr-xr-xlib/private/request.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/request.php b/lib/private/request.php
index 347d77b3724..8041c4f0048 100755
--- a/lib/private/request.php
+++ b/lib/private/request.php
@@ -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'];
}