Merge pull request #14324 from owncloud/fix/14320

Check if instance is not yet installed
This commit is contained in:
Clark Tomlinson 2015-02-18 09:40:32 -05:00
commit c4fdb9cc24
2 changed files with 3 additions and 2 deletions

View 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');

View File

@ -164,7 +164,7 @@ class OC_Setup {
&& is_array($options['trusted_domains'])) {
$trustedDomains = $options['trusted_domains'];
} else {
$trustedDomains = [\OCP\Util::getServerHostName()];
$trustedDomains = [$request->getInsecureServerHost()];
}
if (OC_Util::runningOnWindows()) {
@ -187,7 +187,7 @@ class OC_Setup {
'secret' => $secret,
'trusted_domains' => $trustedDomains,
'datadirectory' => $dataDir,
'overwrite.cli.url' => $request->getServerProtocol() . '://' . $request->getServerHost() . OC::$WEBROOT,
'overwrite.cli.url' => $request->getServerProtocol() . '://' . $request->getInsecureServerHost() . OC::$WEBROOT,
'dbtype' => $dbType,
'version' => implode('.', OC_Util::getVersion()),
]);