From 8ed06948fabe0edebe7e9fbf28ac1fd8fe1d07d4 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Fri, 1 Jul 2011 14:22:59 +0000 Subject: [PATCH] Fix for Bug #29628 - scriptpath Option of maintenance/install.php is ignored MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- CREDITS | 1 + includes/installer/Installer.php | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) 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'] ) ? -- 2.20.1