* Pop up a download box for LocalSettings.php when the user goes to page=Complete...
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 7 Dec 2010 02:01:07 +0000 (02:01 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 7 Dec 2010 02:01:07 +0000 (02:01 +0000)
* Fix MIME type on LocalSettings.php download to not be something that IE considers ambiguous. In Firefox, this makes it say "which is a: PHP file" instead of "plain text document" in the download dialog box.

includes/installer/WebInstaller.php
includes/installer/WebInstallerPage.php

index 9d223eb..ec23b0f 100644 (file)
@@ -121,7 +121,7 @@ class WebInstaller extends CoreInstaller {
                if( ( $this->getVar( '_InstallDone' ) || $this->getVar( '_UpgradeDone' ) )
                        && $this->request->getVal( 'localsettings' ) )
                {
-                       $this->request->response()->header( 'Content-type: text/plain' );
+                       $this->request->response()->header( 'Content-type: application/x-httpd-php' );
                        $this->request->response()->header(
                                'Content-Disposition: attachment; filename="LocalSettings.php"'
                        );
index be2a780..7118dab 100644 (file)
@@ -940,11 +940,16 @@ class WebInstaller_Install extends WebInstallerPage {
 class WebInstaller_Complete extends WebInstallerPage {
        
        public function execute() {
+               // Pop up a dialog box, to make it difficult for the user to forget 
+               // to download the file
+               $lsUrl = $GLOBALS['wgServer'] . $this->parent->getURL( array( 'localsettings' => 1 ) );
+               $this->parent->request->response()->header( "Refresh: 0;$lsUrl" );
+
                $this->startForm();
                $this->addHTML(
                        $this->parent->getInfoBox(
                                wfMsgNoTrans( 'config-install-done',
-                                       $GLOBALS['wgServer'] . $this->parent->getURL( array( 'localsettings' => 1 ) ),
+                                       $lsUrl,
                                        $GLOBALS['wgServer'] .
                                                $this->getVar( 'wgScriptPath' ) . '/index' .
                                                $this->getVar( 'wgScriptExtension' )