* (bug 7932) Make sure that edit toolbar clears floats so it appears correctly.
* (bug 6873) When viewing old revisions, add link to diff to current version.
* (bug 3315) Allow rollback directly from history page.
+* Detect CGI configurations where PATH_INFO is set up correctly.
+ PHP config var cgi.fix_pathinfo isn't detectable through ini_get(), but
+ we can find some side-effects. Only tested on lighttpd so far, hopefully
+ right on Apache too!
== Languages updated ==
case "apache2handler":
print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
break;
-default:
- print "unknown; ";
case "cgi":
case "cgi-fcgi":
+ // For some reason cgi.fix_pathinfo isn't retrievable via ini_get()
+ if( isset( $_SERVER['ORIG_PATH_INFO'] ) ) {
+ echo "cgi.fix_pathinfo is set, good; ";
+ } else {
+ echo "cgi.fix_pathinfo is not set, assuming PATH_INFO broken; ";
+ $conf->prettyURLs = false;
+ }
+ break;
case "apache2filter":
case "isapi":
- print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
+ // Pretty sure these two break from past tests
$conf->prettyURLs = false;
break;
+default:
+ print "unknown, assuming PATH_INFO broken for safety; ";
+ $conf->prettyURLs = false;
+}
+if( $conf->prettyURLs ) {
+ print "ok, using pretty URLs (<tt>index.php/Page_Title</tt>)";
+} else {
+ print "using ugly URLs (<tt>index.php?title=Page_Title</tt>)";
}
print "</li>\n";
$conf->IP = dirname( dirname( __FILE__ ) );
print "<li>Installation directory: <tt>" . htmlspecialchars( $conf->IP ) . "</tt></li>\n";
-$conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $_SERVER["PHP_SELF"] ); # was SCRIPT_NAME
+
+// 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
+$path = ($_SERVER["PHP_SELF"] === '')
+ ? $_SERVER["SCRIPT_NAME"]
+ : $_SERVER["PHP_SELF"];
+$conf->ScriptPath = preg_replace( '{^(.*)/config.*$}', '$1', $path );
print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</tt></li>\n";
print "<li style='font-weight:bold;color:green;font-size:110%'>Environment checked. You can install MediaWiki.</li>\n";
## For more information on customizing the URLs please see:
## http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
-## If using PHP as a CGI module, the ?title= style usually must be used.
+
+## 'Pretty' URLs using PATH_INFO work on most configurations with
+## PHP configured as an Apache module.
{$pretty}\$wgArticlePath = \"\$wgScript/\$1\";
+
+## If using PHP as a CGI module, the ?title= style might have to be used
+## depending on the configuration. If it fails, try enabling the option
+## cgi.fix_pathinfo in php.ini, then switch to pretty URLs.
{$ugly}\$wgArticlePath = \"\$wgScript?title=\$1\";
\$wgStylePath = \"\$wgScriptPath/skins\";
/**
* Whether to support URLs like index.php/Page_title
+ * These often break when PHP is set up in CGI mode, so
+ * ignore PATH_INFO for CGI unless cgi.fix_pathinfo is
+ * set.
+ *
+ * Override this to false if $_SERVER['PATH_INFO']
+ * contains unexpectedly incorrect garbage.
+ *
+ * Note that having this incorrectly set to true can
+ * cause redirect loops when "pretty URLs" are used.
+ *
* @global bool $wgUsePathInfo
*/
-$wgUsePathInfo = ( strpos( php_sapi_name(), 'cgi' ) === false );
-
+$wgUsePathInfo =
+ ( strpos( php_sapi_name(), 'cgi' ) === false ) ||
+ isset( $_SERVER['ORIG_PATH_INFO'] );
/**#@+
* Script users will request to get articles