Taueres has uploaded a new change for review. https://gerrit.wikimedia.org/r/131334
Change subject: Installer: output css correctly when session errors occur ...................................................................... Installer: output css correctly when session errors occur CSS was not showing correctly when session errors occurred. This was caused because mw-config/index.php was not taking into account the "css" parameter passed in the URL. Change-Id: I500c7340ab6826d428e9e3be28bcfc7ca5ed8466 --- M includes/installer/WebInstaller.php M mw-config/index.php 2 files changed, 27 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/34/131334/1 diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index d897507..34d919d 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -182,10 +182,7 @@ $cssDir = $this->request->getVal( 'css' ); if ( $cssDir ) { - $cssDir = ( $cssDir == 'rtl' ? 'rtl' : 'ltr' ); - $this->request->response()->header( 'Content-type: text/css' ); - echo $this->output->getCSS( $cssDir ); - + $this->outputCss( $cssDir ); return $this->session; } @@ -354,8 +351,6 @@ restore_error_handler(); if ( $this->phpErrors ) { - $this->showError( 'config-session-error', $this->phpErrors[0] ); - return false; } @@ -1161,4 +1156,20 @@ return WebRequest::detectServer(); } + /** + * @param string $dir CSS direction ( rtl or ltr ) + */ + public function outputCss( $dir ) { + $dir = ( $dir == 'rtl' ? 'rtl' : 'ltr' ); + $this->request->response()->header( 'Content-type: text/css' ); + echo $this->output->getCSS( $dir ); + } + + /** + * @return string[] + */ + public function getPhpErrors() { + return $this->phpErrors; + } + } diff --git a/mw-config/index.php b/mw-config/index.php index fc7eadb..d22454f 100644 --- a/mw-config/index.php +++ b/mw-config/index.php @@ -36,6 +36,16 @@ $installer = InstallerOverrides::getWebInstaller( $wgRequest ); if ( !$installer->startSession() ) { + + if( $installer->request->getVal( "css" ) ) { + // Do not display errors on css pages + $cssDir = $installer->request->getVal( "css" ); + $installer->outputCss( $cssDir ); + exit; + } + + $errors = $installer->getPhpErrors(); + $installer->showError( 'config-session-error', $errors[0] ); $installer->finish(); exit; } -- To view, visit https://gerrit.wikimedia.org/r/131334 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I500c7340ab6826d428e9e3be28bcfc7ca5ed8466 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Taueres <santoro....@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits