summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-09-08 16:15:31 +0200
committerLukas Reschke <lukas@owncloud.com>2014-09-08 16:15:31 +0200
commit2590a4dc85cb23311a9000770bf506c3953d0b04 (patch)
treec32fbf160209816e434df4fc3560b32c8a609b4d /lib/base.php
parentbd63f475bc4d9c4c17caf5ad75f37dc342013dd3 (diff)
downloadnextcloud-server-2590a4dc85cb23311a9000770bf506c3953d0b04.tar.gz
nextcloud-server-2590a4dc85cb23311a9000770bf506c3953d0b04.zip
Append port to trusted domain in case it's not 80 or 443
Ref https://github.com/owncloud/core/pull/10584#issuecomment-54677059
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php12
1 files 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();
}
}