From: Chad Horohoe Date: Tue, 29 Mar 2011 17:06:26 +0000 (+0000) Subject: (bug 26481) $wgUpgradeKey/$wgSecretKey values sometimes not filled - only happened... X-Git-Tag: 1.31.0-rc.0~31144 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=15aa72fbd7fd1f7e236e44771033d7f6052f2e5c;p=lhc%2Fweb%2Fwiklou.git (bug 26481) $wgUpgradeKey/$wgSecretKey values sometimes not filled - only happened when you upgrade without LocalSettings and tried to create a new one --- 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';