[Pkg-owncloud-commits] [owncloud] 06/55: Fixed X-Forwarded-Host parsing

David Prévot taffit at moszumanska.debian.org
Wed Apr 23 19:51:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v5.0.16RC1
in repository owncloud.

commit 7ba91c346f60a0e1f886ed5f04ac7de4cc1e20fa
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Mar 5 17:04:45 2014 +0100

    Fixed X-Forwarded-Host parsing
    
    Backport of d7163c9 from stable6
---
 lib/request.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/request.php b/lib/request.php
index 07ad808..4c627db 100755
--- a/lib/request.php
+++ b/lib/request.php
@@ -51,7 +51,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'];
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list