Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2014-02-22 11:07:57 +0400
committerLukas Reschke <lukas@statuscode.ch>2014-02-22 11:24:57 +0400
commite9671c9c24e28a4baa96e0447f1d878a112b528b (patch)
tree43db25ad9b4913e57591fd8bedd77095ae754e77 /lib/updater.php
parentb88654561dc639637a5ac56832023b33dc85e284 (diff)
Backport #7259 to stable5
Diffstat (limited to 'lib/updater.php')
-rw-r--r--lib/updater.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/updater.php b/lib/updater.php
index d0ae1fb4715..ec10377a4b9 100644
--- a/lib/updater.php
+++ b/lib/updater.php
@@ -97,6 +97,19 @@ class OC_Updater extends BasicEmitter {
$currentVersion = implode('.', \OC_Util::getVersion());
\OC_Log::write('core', 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, \OC_Log::WARN);
$this->emit('\OC_Updater', 'maintenanceStart');
+
+ /*
+ * START CONFIG CHANGES FOR OLDER VERSIONS
+ */
+ if (version_compare($currentVersion, '5.00.29', '<')) {
+ // 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');
@@ -157,4 +170,4 @@ class OC_Updater extends BasicEmitter {
}
$this->emit('\OC_Updater', 'filecacheDone');
}
-} \ No newline at end of file
+}