From 15aa72fbd7fd1f7e236e44771033d7f6052f2e5c Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 29 Mar 2011 17:06:26 +0000 Subject: [PATCH] (bug 26481) $wgUpgradeKey/$wgSecretKey values sometimes not filled - only happened when you upgrade without LocalSettings and tried to create a new one --- includes/installer/Installer.php | 2 +- includes/installer/WebInstallerPage.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index e9f970b3c5..5535bd8ef7 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1312,7 +1312,7 @@ abstract class Installer { * * @return Status */ - protected function generateSecretKey() { + public function generateSecretKey() { return $this->generateSecret( 'wgSecretKey' ); } diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index efb23b2618..ef35b247aa 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -475,6 +475,12 @@ class WebInstaller_Upgrade extends WebInstallerPage { ' ); $this->parent->output->flush(); if ( $result ) { + // If they're going to possibly regenerate LocalSettings, we + // need to create the upgrade/secret keys. Bug 26481 + if( !$this->getVar( '_ExistingDBSettings' ) ) { + $this->parent->generateSecretKey(); + $this->parent->generateUpgradeKey(); + } $this->setVar( '_UpgradeDone', true ); $this->showDoneMessage(); return 'output'; -- 2.20.1