Append port to trusted domain in case it's not 80 or 443

Ref https://github.com/owncloud/core/pull/10584#issuecomment-54677059
This commit is contained in:
Lukas Reschke 2014-09-08 16:15:31 +02:00
parent bd63f475bc
commit 2590a4dc85
1 changed files with 10 additions and 2 deletions

View File

@ -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();
}
}