From b267496b81b9ddb2b9c30ccbd152c1e20c8b138b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 8 Jul 2011 14:25:01 +0000 Subject: [PATCH] Revert r91263 (fixing $wgScriptPath for cli installer). Completely breaks the web installer for two important reasons: * $wgScriptPath always has a default value of '/wiki', so the getVar() check will always be true and skip the environment check * Also began returning true in the SCRIPT_NAME which would mean $wgScriptPath never got set Breakage spotted by LewisCawte on IRC, thanks! --- CREDITS | 1 - includes/installer/Installer.php | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CREDITS b/CREDITS index dfde8873af..a3b13e562d 100644 --- a/CREDITS +++ b/CREDITS @@ -150,7 +150,6 @@ following names for their contribution to the product. * svip * The Evil IP address * Tisane -* Tobias Müller * Umherirrender * Ville Stadista * Vitaliy Filippov diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index dfc56e97e7..f9f59cdf73 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -860,13 +860,12 @@ 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 ( $this->getVar( 'wgScriptPath' ) ) { - // Some kind soul has set it for us already (e.g. debconf) - return true; - } elseif ( !empty( $_SERVER['PHP_SELF'] ) ) { + if ( !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' ); @@ -1250,7 +1249,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