(bug 26481) $wgUpgradeKey/$wgSecretKey values sometimes not filled - only happened...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 29 Mar 2011 17:06:26 +0000 (17:06 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 29 Mar 2011 17:06:26 +0000 (17:06 +0000)
includes/installer/Installer.php
includes/installer/WebInstallerPage.php

index e9f970b..5535bd8 100644 (file)
@@ -1312,7 +1312,7 @@ abstract class Installer {
         *
         * @return Status
         */
-       protected function generateSecretKey() {
+       public function generateSecretKey() {
                return $this->generateSecret( 'wgSecretKey' );
        }
 
index efb23b2..ef35b24 100644 (file)
@@ -475,6 +475,12 @@ class WebInstaller_Upgrade extends WebInstallerPage {
 <script>jQuery( "#config-spinner" )[0].style.display = "none";</script>' );
                        $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';