Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -100,6 +100,7 @@ |
101 | 101 | # The debug log file should be not be publically accessible if it is |
102 | 102 | # used, as it may contain private data. |
103 | 103 | $wgDebugLogFile = ""; |
| 104 | +$wgDebugRedirects = false; |
104 | 105 | |
105 | 106 | $wgDebugComments = false; |
106 | 107 | $wgReadOnly = false; |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -228,6 +228,7 @@ |
229 | 229 | { |
230 | 230 | global $wgUser, $wgLang, $wgDebugComments, $wgCookieExpiration; |
231 | 231 | global $wgInputEncoding, $wgOutputEncoding, $wgLanguageCode; |
| 232 | + global $wgDebugRedirects; |
232 | 233 | if( $this->mDoNothing ){ |
233 | 234 | return; |
234 | 235 | } |
— | — | @@ -236,25 +237,34 @@ |
237 | 238 | |
238 | 239 | $sk = $wgUser->getSkin(); |
239 | 240 | |
240 | | - |
241 | 241 | if ( "" != $this->mRedirect ) { |
242 | 242 | if( substr( $this->mRedirect, 0, 4 ) != "http" ) { |
243 | 243 | # Standards require redirect URLs to be absolute |
244 | 244 | global $wgServer; |
245 | 245 | $this->mRedirect = $wgServer . $this->mRedirect; |
246 | 246 | } |
247 | | - if( $this->mRdirectCode == '301') { |
248 | | - header("HTTP/1.1 {$this->mRedirectCode} Moved Permanently"); |
| 247 | + if( $this->mRedirectCode == '301') { |
| 248 | + if( !$wgDebugRedirects ) { |
| 249 | + header("HTTP/1.1 {$this->mRedirectCode} Moved Permanently"); |
| 250 | + } |
249 | 251 | $this->mLastModified = gmdate( "D, j M Y H:i:s", wfTimestamp2Unix( |
250 | 252 | max( $timestamp, $wgUser->mTouched ) ) ) . " GMT"; |
251 | 253 | } |
252 | 254 | |
253 | 255 | $this->sendCacheControl(); |
254 | 256 | |
255 | | - header( "Location: {$this->mRedirect}" ); |
| 257 | + if( $wgDebugRedirects ) { |
| 258 | + $url = htmlspecialchars( $this->mRedirect ); |
| 259 | + print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n"; |
| 260 | + print "<p>Location: <a href=\"$url\">$url</a></p>\n"; |
| 261 | + print "</body>\n</html>\n"; |
| 262 | + } else { |
| 263 | + header( "Location: {$this->mRedirect}" ); |
| 264 | + } |
256 | 265 | return; |
257 | 266 | } |
258 | 267 | |
| 268 | + |
259 | 269 | $this->sendCacheControl(); |
260 | 270 | |
261 | 271 | header( "Content-type: text/html; charset={$wgOutputEncoding}" ); |