summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-12-02 10:48:41 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-12-07 09:53:06 +0100
commitd05f131929b8812cac1c1e08bf8098d6df03b191 (patch)
tree130b90dd57776b587efccb767413e8fec21a7cc3 /lib
parent2959487f71c8226036ac3614bce27e3bbe60418a (diff)
downloadnextcloud-server-d05f131929b8812cac1c1e08bf8098d6df03b191.tar.gz
nextcloud-server-d05f131929b8812cac1c1e08bf8098d6df03b191.zip
Move overwritehost check to isTrustedDomain
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php3
-rw-r--r--lib/private/Security/TrustedDomainHelper.php5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php
index 436b2a2aeea..b0991307dda 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -760,9 +760,6 @@ class OC {
* FIXME: Should not be in here at all :see_no_evil:
*/
if (!OC::$CLI
- // overwritehost is always trusted, workaround to not have to make
- // \OC\AppFramework\Http\Request::getOverwriteHost public
- && self::$server->getConfig()->getSystemValue('overwritehost') === ''
&& !\OC::$server->getTrustedDomainHelper()->isTrustedDomain($host)
&& self::$server->getConfig()->getSystemValue('installed', false)
) {
diff --git a/lib/private/Security/TrustedDomainHelper.php b/lib/private/Security/TrustedDomainHelper.php
index 5cbc08d0fd3..dc6b10c92b3 100644
--- a/lib/private/Security/TrustedDomainHelper.php
+++ b/lib/private/Security/TrustedDomainHelper.php
@@ -70,6 +70,11 @@ class TrustedDomainHelper {
* have been configured
*/
public function isTrustedDomain($domainWithPort) {
+ // overwritehost is always trusted
+ if ($this->config->getSystemValue('overwritehost') !== '') {
+ return true;
+ }
+
$domain = $this->getDomainWithoutPort($domainWithPort);
// Read trusted domains from config