From 2590a4dc85cb23311a9000770bf506c3953d0b04 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 8 Sep 2014 16:15:31 +0200 Subject: Append port to trusted domain in case it's not 80 or 443 Ref https://github.com/owncloud/core/pull/10584#issuecomment-54677059 --- lib/base.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/base.php b/lib/base.php index fb445124011..64a3990b8f4 100644 --- a/lib/base.php +++ b/lib/base.php @@ -593,10 +593,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(); } } -- cgit v1.2.3