r111198 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111197‎ | r111198 | r111199 >
Date:20:37, 10 February 2012
Author:mah
Status:ok
Tags:
Comment:
Re r111197 Fix Bug 33691 - PHP Warning on showing Release Notes due to the fact that file does not exist
Patch from moejoe0000
Modified paths:
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -550,6 +550,7 @@
551551 When that has been done, you can '''[$2 enter your wiki]'''.",
552552 'config-download-localsettings' => 'Download LocalSettings.php',
553553 'config-help' => 'help',
 554+ 'config-nofile' => 'File "$1" could not be found. Has it been deleted?',
554555 'mainpagetext' => "'''MediaWiki has been successfully installed.'''",
555556 'mainpagedocfooter' => "Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.
556557
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -1251,7 +1251,11 @@
12521252 }
12531253
12541254 public function getFileContents() {
1255 - return file_get_contents( dirname( __FILE__ ) . '/../../' . $this->getFileName() );
 1255+ $file = dirname( __FILE__ ) . '/../../' . $this->getFileName();
 1256+ if( ! file_exists( $file ) ) {
 1257+ return wfMsgNoTrans( 'config-nofile', $file );
 1258+ }
 1259+ return file_get_contents( $file );
12561260 }
12571261
12581262 }
@@ -1261,7 +1265,15 @@
12621266 }
12631267
12641268 class WebInstaller_ReleaseNotes extends WebInstaller_Document {
1265 - protected function getFileName() { return 'RELEASE-NOTES'; }
 1269+ protected function getFileName() {
 1270+ global $wgVersion;
 1271+
 1272+ if(! preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) {
 1273+ throw new MWException('Variable $wgVersion has an invalid value.');
 1274+ }
 1275+
 1276+ return 'RELEASE-NOTES-' . $result[1] . '.' . $result[2];
 1277+ }
12661278 }
12671279
12681280 class WebInstaller_UpgradeDoc extends WebInstaller_Document {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111197Fix Bug 33691 - PHP Warning on showing Release Notes due to the fact that fil...mah20:36, 10 February 2012

Status & tagging log