Followup r76391 per CR: just do $wgUpgradeKey in generateSecretKey()
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 9 Nov 2010 17:01:09 +0000 (17:01 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 9 Nov 2010 17:01:09 +0000 (17:01 +0000)
includes/installer/CoreInstaller.php

index f916280..861409a 100644 (file)
@@ -308,7 +308,6 @@ abstract class CoreInstaller extends Installer {
                        array( 'name' => 'tables',    'callback' => array( $this, 'installTables' ) ),
                        array( 'name' => 'interwiki', 'callback' => array( $installer, 'populateInterwikiTable' ) ),
                        array( 'name' => 'secretkey', 'callback' => array( $this, 'generateSecretKey' ) ),
-                       array( 'name' => 'upgradekey', 'callback' => array( $this, 'generateUpgradeKey' ) ),
                        array( 'name' => 'sysop',     'callback' => array( $this, 'createSysop' ) ),
                        array( 'name' => 'mainpage',  'callback' => array( $this, 'createMainpage' ) ),
                );
@@ -395,20 +394,12 @@ abstract class CoreInstaller extends Installer {
 
                $this->setVar( 'wgSecretKey', $secretKey );
 
-               return $status;
-       }
+               // Generate a $wgUpgradeKey from our secret key
+               $secretKey = md5( $secretKey );
+               $randPos = mt_rand( 0, strlen( $secretKey ) - 8 );
+               $this->setVar( 'wgUpgradeKey', substr( $secretKey, $randPos, $randPos + 8 ) );
 
-       /**
-        * Generate a default $wgUpradeKey, using a semi-random 8 character portion
-        * of md5($wgSecretKey)
-        *
-        * @return Status
-        */
-       protected function generateUpgradeKey() {
-               $secret = md5( $this->getVar( 'wgSecretKey' ) );
-               $randPos = mt_rand( 0, strlen( $secret ) - 8 );
-               $this->setVar( 'wgUpgradeKey', substr( $secret, $randPos, $randPos + 8 ) );
-               return Status::newGood();
+               return $status;
        }
 
        /**