https://bugzilla.wikimedia.org/show_bug.cgi?id=33691

--- Comment #2 from moejoe000 <[email protected]> 2012-01-14 10:01:33 UTC ---
For me the following modification of /includes/installer/WebInstallerPage.php
works well:

--- trunk/phase3/includes/installer/WebInstallerPage.php (revision 108689)
+++ trunk/phase3/includes/installer/WebInstallerPage.php (working copy)
@@ 1245,3 1245,11 @@
 class WebInstaller_UpgradeDoc extends WebInstaller_Document {
-    protected function getFileName() { return 'RELEASE-NOTES'; }
+    protected function getFileName() {
+        global $wgVersion;
+
+        if(! preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) {
+            throw new MWException('Variable $wgVersion has an invalid
value.');
+        }
+
+        return 'RELEASE-NOTES-' . $result[1] . '.' . $result[2]; 
+    }
 }

Moreover, for me it seems rasonable to check if the user has deleted (or
renamed...) one of the files:

--- trunk/phase3/includes/installer/WebInstallerPage.php (revision 108689)
+++ trunk/phase3/includes/installer/WebInstallerPage.php (working copy)
@@ 1235,3 1235,7 @@
     public function getFileContents() {
-        return file_get_contents( dirname( __FILE__ ) . '/../../' .
$this->getFileName() );
+        $file = dirname( __FILE__ ) . '/../../' . $this->getFileName();
+        if( ! file_exists( $file ) ) {
+            return wfMsgNoTrans( 'config-nofile', $file );
+        }
+        return file_get_contents( $file );
    }
--- trunk/phase3/includes/installer/Installer.i18n.php (revision 108689)
+++ trunk/phase3/includes/installer/Installer.i18n.php (working copy)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to