From: Mark A. Hershberger Date: Fri, 1 Jul 2011 14:22:59 +0000 (+0000) Subject: Fix for Bug #29628 - scriptpath Option of maintenance/install.php is ignored X-Git-Tag: 1.31.0-rc.0~29124 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=8ed06948fabe0edebe7e9fbf28ac1fd8fe1d07d4;p=lhc%2Fweb%2Fwiklou.git Fix for Bug #29628 - scriptpath Option of maintenance/install.php is ignored The Script Path Option (--scriptpath) of maintenance/install.php is silently ignored if there is $_SERVER['SCRIPT_NAME'] set. Apply patch from Tobias Müller. --- diff --git a/CREDITS b/CREDITS index 8bc7a26424..d837fbccc1 100644 --- a/CREDITS +++ b/CREDITS @@ -148,6 +148,7 @@ following names for their contribution to the product. * Str4nd * svip * Tisane +* Tobias Müller * Umherirrender * Ville Stadista * Vitaliy Filippov diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index f9f59cdf73..dfc56e97e7 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -860,12 +860,13 @@ abstract class Installer { // PHP_SELF isn't available sometimes, such as when PHP is CGI but // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME // to get the path to the current script... hopefully it's reliable. SIGH - if ( !empty( $_SERVER['PHP_SELF'] ) ) { + if ( $this->getVar( 'wgScriptPath' ) ) { + // Some kind soul has set it for us already (e.g. debconf) + return true; + } elseif ( !empty( $_SERVER['PHP_SELF'] ) ) { $path = $_SERVER['PHP_SELF']; } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) { $path = $_SERVER['SCRIPT_NAME']; - } elseif ( $this->getVar( 'wgScriptPath' ) ) { - // Some kind soul has set it for us already (e.g. debconf) return true; } else { $this->showError( 'config-no-uri' ); @@ -1249,7 +1250,7 @@ abstract class Installer { require( "$IP/includes/DefaultSettings.php" ); foreach( $exts as $e ) { - require_once( "$IP/extensions/$e/$e.php" ); + require_once( "$IP/extensions/$e/$e.php" ); } $hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ?