]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed X-Forwarded-Host parsing
authorVincent Petry <pvince81@owncloud.com>
Wed, 5 Mar 2014 16:04:45 +0000 (17:04 +0100)
committerVincent Petry <pvince81@owncloud.com>
Thu, 6 Mar 2014 10:51:25 +0000 (11:51 +0100)
lib/private/request.php

index 347d77b37241d1d903413ac49639d1d446969a8a..8041c4f004867241b019529be34e56ef84b5b75c 100755 (executable)
@@ -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'];
                        }