]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if instance is not yet installed
authorLukas Reschke <lukas@owncloud.com>
Wed, 18 Feb 2015 12:06:46 +0000 (13:06 +0100)
committerLukas Reschke <lukas@owncloud.com>
Wed, 18 Feb 2015 12:06:46 +0000 (13:06 +0100)
Due to a security hardening in 8.1 a missing value of empty trusted domains in the config would provoke an error as this was misused by a lot of users.

This caused a problem where the initial installation happened from another domain than 127.0.0.1 as in this case the domain was considered untrusted as no value was defined. However, this special case should not get intercepted.

To test:
- [ ] Installing ownCloud on 127.0.0.1 works
- [ ] Installing ownCloud on another domain / IP works
- [ ] When setting up ownCloud from 127.0.0.1 and accessing it from the domain above the trusted domain error should be shown if not specified in the config

Fixes https://github.com/owncloud/core/issues/14320

lib/base.php

index cdc662c28d968f1b70cb7549265f30fbc9634af7..93f7a2a9b21101ddac20109605599de7f04d2962 100644 (file)
@@ -637,6 +637,7 @@ class OC {
                        // \OC\AppFramework\Http\Request::getOverwriteHost public
                        && self::$server->getConfig()->getSystemValue('overwritehost') === ''
                        && !\OC::$server->getTrustedDomainHelper()->isTrustedDomain($host)
+                       && self::$server->getConfig()->getSystemValue('installed', false)
                ) {
                        header('HTTP/1.1 400 Bad Request');
                        header('Status: 400 Bad Request');