LocalSettings.php must be readable by the server
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 7 Mar 2014 18:11:09 +0000 (19:11 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Fri, 7 Mar 2014 18:11:09 +0000 (19:11 +0100)
Change check in WebStart to is_readable and output a different
text on NoLocalSettings template, when the file exists.

Bug: 61094
Change-Id: I4dbdb33e468bc731fa1d6eef8e0f66e1d552d0f8

includes/WebStart.php
includes/templates/NoLocalSettings.php

index 58c953a..eb79134 100644 (file)
@@ -126,8 +126,8 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
 
        # LocalSettings.php is the per site customization file. If it does not exist
        # the wiki installer needs to be launched or the generated file uploaded to
-       # the root wiki directory
-       if ( !file_exists( MW_CONFIG_FILE ) ) {
+       # the root wiki directory. Give a hint, if it is not readable by the server.
+       if ( !is_readable( MW_CONFIG_FILE ) ) {
                require_once "$IP/includes/templates/NoLocalSettings.php";
                die();
        }
index 3f49ed3..d5b8d8b 100644 (file)
@@ -75,16 +75,21 @@ if ( !function_exists( 'session_name' ) ) {
 
                <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1>
                <div class='error'>
-               <p>LocalSettings.php not found.</p>
-               <p>
-               <?php
-               if ( $installerStarted ) {
-                       echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php.";
-               } else {
-                       echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first.";
-               }
-               ?>
-               </p>
+               <?php if ( !file_exists( MW_CONFIG_FILE ) ) { ?>
+                       <p>LocalSettings.php not found.</p>
+                       <p>
+                       <?php
+                       if ( $installerStarted ) {
+                               echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php.";
+                       } else {
+                               echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first.";
+                       }
+                       ?>
+                       </p>
+               <?php } else { ?>
+                       <p>LocalSettings.php not readable.</p>
+                       <p>Please correct file permissions and try again.</p>
+               <?php } ?>
 
                </div>
        </body>