diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2014-02-18 16:26:37 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-02-21 15:19:01 +0100 |
commit | fe44ac264bd8f636c1189d6ad6430ac991038ae6 (patch) | |
tree | 40af92ef770fee2cea520165b10648ed794485c4 /lib/private/updater.php | |
parent | 92560c5b86cb88920b6e439bdf4b90f1d59e9b6c (diff) | |
download | nextcloud-server-fe44ac264bd8f636c1189d6ad6430ac991038ae6.tar.gz nextcloud-server-fe44ac264bd8f636c1189d6ad6430ac991038ae6.zip |
Add overwritehost config on setup and upgrade
Diffstat (limited to 'lib/private/updater.php')
-rw-r--r-- | lib/private/updater.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php index 764a0f14120..f05d5038b76 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -102,6 +102,20 @@ class Updater extends BasicEmitter { $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core')); } $this->emit('\OC\Updater', 'maintenanceStart'); + + /* + * START CONFIG CHANGES FOR OLDER VERSIONS + */ + if (version_compare($currentVersion, '6.90.1', '<')) { + // Add the overwriteHost config if it is not existant + // This is added to prevent host header poisoning + \OC_Config::setValue('trusted_domains', \OC_Config::getValue('trusted_domains', array(\OC_Request::serverHost()))); + } + /* + * STOP CONFIG CHANGES FOR OLDER VERSIONS + */ + + try { \OC_DB::updateDbFromStructure(\OC::$SERVERROOT . '/db_structure.xml'); $this->emit('\OC\Updater', 'dbUpgrade'); @@ -162,3 +176,4 @@ class Updater extends BasicEmitter { $this->emit('\OC\Updater', 'filecacheDone'); } } + |