* (bug 8847) Strip spurious #fragments from request URI to fix redirect loops on some server configurations

This commit is contained in:
Brion Vibber 2007-03-05 18:54:27 +00:00
parent fbe7f1a859
commit fd11a81597
2 changed files with 11 additions and 0 deletions

View file

@ -246,6 +246,9 @@ lighter making things easier to read.
* (bug 8747) When unwatching pages from Special:Watchlist/edit, put the
confirmation messages in a proper list with a CSS class and id.
* (bug 9155) Allow footer info to wrap in Monobook
* (bug 8847) Strip spurious #fragments from request URI to fix redirect
loops on some server configurations
== Languages updated ==

View file

@ -331,6 +331,14 @@ class WebRequest {
"REQUEST_URI or SCRIPT_NAME. Report details of your " .
"web server configuration to http://bugzilla.wikimedia.org/" );
}
// User-agents should not send a fragment with the URI, but
// if they do, and the web server passes it on to us, we
// need to strip it or we get false-positive redirect loops
// or weird output URLs
$hash = strpos( $base, '#' );
if( $hash !== false ) {
$base = substr( $base, 0, $hash );
}
if( $base{0} == '/' ) {
return $base;
} else {