Index: trunk/phase3/CREDITS |
— | — | @@ -94,6 +94,7 @@ |
95 | 95 | * Dan Nessett |
96 | 96 | * Daniel Arnold |
97 | 97 | * Denny Vrandecic |
| 98 | +* Edward Z. Yang |
98 | 99 | * Erwin Dokter |
99 | 100 | * FunPika |
100 | 101 | * Gero Scholz |
Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -1007,6 +1007,20 @@ |
1008 | 1008 | } |
1009 | 1009 | } |
1010 | 1010 | |
| 1011 | + // PHP_SELF isn't available sometimes, such as when PHP is CGI but |
| 1012 | + // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME |
| 1013 | + // to get the path to the current script... hopefully it's reliable. SIGH |
| 1014 | + $path = false; |
| 1015 | + if ( !empty( $_SERVER['PHP_SELF'] ) ) { |
| 1016 | + $path = $_SERVER['PHP_SELF']; |
| 1017 | + } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) { |
| 1018 | + $path = $_SERVER['SCRIPT_NAME']; |
| 1019 | + } |
| 1020 | + if ($path !== false) { |
| 1021 | + $uri = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path ); |
| 1022 | + $this->setVar( 'wgScriptPath', $uri ); |
| 1023 | + } |
| 1024 | + |
1011 | 1025 | return $newValues; |
1012 | 1026 | } |
1013 | 1027 | |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -857,26 +857,7 @@ |
858 | 858 | protected function envCheckPath() { |
859 | 859 | global $IP; |
860 | 860 | $IP = dirname( dirname( dirname( __FILE__ ) ) ); |
861 | | - |
862 | 861 | $this->setVar( 'IP', $IP ); |
863 | | - |
864 | | - // PHP_SELF isn't available sometimes, such as when PHP is CGI but |
865 | | - // cgi.fix_pathinfo is disabled. In that case, fall back to SCRIPT_NAME |
866 | | - // to get the path to the current script... hopefully it's reliable. SIGH |
867 | | - if ( !empty( $_SERVER['PHP_SELF'] ) ) { |
868 | | - $path = $_SERVER['PHP_SELF']; |
869 | | - } elseif ( !empty( $_SERVER['SCRIPT_NAME'] ) ) { |
870 | | - $path = $_SERVER['SCRIPT_NAME']; |
871 | | - } elseif ( $this->getVar( 'wgScriptPath' ) ) { |
872 | | - // Some kind soul has set it for us already (e.g. debconf) |
873 | | - return true; |
874 | | - } else { |
875 | | - $this->showError( 'config-no-uri' ); |
876 | | - return false; |
877 | | - } |
878 | | - |
879 | | - $uri = preg_replace( '{^(.*)/(mw-)?config.*$}', '$1', $path ); |
880 | | - $this->setVar( 'wgScriptPath', $uri ); |
881 | 862 | } |
882 | 863 | |
883 | 864 | /** |
— | — | @@ -1252,7 +1233,7 @@ |
1253 | 1234 | require( "$IP/includes/DefaultSettings.php" ); |
1254 | 1235 | |
1255 | 1236 | foreach( $exts as $e ) { |
1256 | | - require_once( "$IP/extensions/$e/$e.php" ); |
| 1237 | + require_once( "$IP/extensions/$e/$e.php" ); |
1257 | 1238 | } |
1258 | 1239 | |
1259 | 1240 | $hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ? |