Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -299,16 +299,27 @@ |
300 | 300 | * |
301 | 301 | * ;:@$!*(),/ |
302 | 302 | * |
| 303 | + * However, IIS7 redirects fail when the url contains a colon (Bug 22709), |
| 304 | + * so no fancy : for IIS7. |
| 305 | + * |
303 | 306 | * %2F in the page titles seems to fatally break for some reason. |
304 | 307 | * |
305 | 308 | * @param $s String: |
306 | 309 | * @return string |
307 | 310 | */ |
308 | 311 | function wfUrlencode( $s ) { |
| 312 | + static $needle; |
| 313 | + if ( is_null( $needle ) ) { |
| 314 | + $needle = array( '%3B','%40','%24','%21','%2A','%28','%29','%2C','%2F' ); |
| 315 | + if (! isset($_SERVER['SERVER_SOFTWARE']) || ( strpos($_SERVER['SERVER_SOFTWARE'], "Microsoft-IIS/7") === false)) { |
| 316 | + $needle[] = '%3A'; |
| 317 | + } |
| 318 | + } |
| 319 | + |
309 | 320 | $s = urlencode( $s ); |
310 | 321 | $s = str_ireplace( |
311 | | - array( '%3B','%3A','%40','%24','%21','%2A','%28','%29','%2C','%2F' ), |
312 | | - array( ';', ':', '@', '$', '!', '*', '(', ')', ',', '/' ), |
| 322 | + $needle, |
| 323 | + array( ';', '@', '$', '!', '*', '(', ')', ',', '/', ':' ), |
313 | 324 | $s |
314 | 325 | ); |
315 | 326 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -36,6 +36,8 @@ |
37 | 37 | when the address changed |
38 | 38 | * (bug 22664) Special:Userrights now accepts '0' as a valid user name |
39 | 39 | * (bug 5210) preload parser now parses <noinclude>, <includeonly> and redirects |
| 40 | +* (bug 22709) IIS7 mishandles redirects generated by OutputPage::output() when |
| 41 | +the URL contains a colon. |
40 | 42 | |
41 | 43 | == API changes in 1.17 == |
42 | 44 | |