From: Brion Vibber Date: Mon, 5 Mar 2007 18:54:27 +0000 (+0000) Subject: * (bug 8847) Strip spurious #fragments from request URI to fix redirect loops on... X-Git-Tag: 1.31.0-rc.0~53905 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=fd11a81597c7e290fc7d2f03d24e449c0fda1a03;p=lhc%2Fweb%2Fwiklou.git * (bug 8847) Strip spurious #fragments from request URI to fix redirect loops on some server configurations --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 10d1146a0f..d6ae979041 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/WebRequest.php b/includes/WebRequest.php index b08fd4e4df..6c058af0c9 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -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 {