[Pkg-owncloud-commits] [owncloud] 130/258: Append port to trusted domain in case it's not 80 or 443

David Prévot taffit at moszumanska.debian.org
Sat Oct 11 17:22:28 UTC 2014


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

taffit pushed a commit to branch master
in repository owncloud.

commit d9384cd9595ea74804a801b4657b212ebd3add70
Author: Lukas Reschke <lukas at owncloud.com>
Date:   Mon Sep 8 16:15:31 2014 +0200

    Append port to trusted domain in case it's not 80 or 443
    
    Ref https://github.com/owncloud/core/pull/10584#issuecomment-54677059
    
    Backport of 2590a4dc85cb23311a9000770bf506c3953d0b04 from master
---
 lib/base.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/base.php b/lib/base.php
index 39da089..3ce5a21 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -572,10 +572,18 @@ class OC {
 		) {
 			header('HTTP/1.1 400 Bad Request');
 			header('Status: 400 Bad Request');
+
+			$domain = $_SERVER['SERVER_NAME'];
+			// Append port to domain in case it is not
+			if($_SERVER['SERVER_PORT'] !== '80' && $_SERVER['SERVER_PORT'] !== '443') {
+				$domain .= ':'.$_SERVER['SERVER_PORT'];
+			}
+
 			$tmpl = new OCP\Template('core', 'untrustedDomain', 'guest');
-			$tmpl->assign('domain', $_SERVER['SERVER_NAME']);
+			$tmpl->assign('domain', $domain);
 			$tmpl->printPage();
-			return;
+
+			exit();
 		}
 	}
 

-- 
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