| 1 | Index: wp-includes/class-wp.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- wp-includes/class-wp.php (revision 18052) |
|---|
| 4 | +++ wp-includes/class-wp.php (working copy) |
|---|
| 5 | @@ -138,12 +138,16 @@ |
|---|
| 6 | $error = '404'; |
|---|
| 7 | $this->did_permalink = true; |
|---|
| 8 | |
|---|
| 9 | - if ( isset($_SERVER['PATH_INFO']) ) |
|---|
| 10 | + $pathinfo = ''; |
|---|
| 11 | + if ( isset( $_SERVER['PATH_INFO'] ) ) { |
|---|
| 12 | $pathinfo = $_SERVER['PATH_INFO']; |
|---|
| 13 | - else |
|---|
| 14 | - $pathinfo = ''; |
|---|
| 15 | - $pathinfo_array = explode('?', $pathinfo); |
|---|
| 16 | - $pathinfo = str_replace("%", "%25", $pathinfo_array[0]); |
|---|
| 17 | + $pathinfo_array = explode('?', $pathinfo); |
|---|
| 18 | + $pathinfo = $pathinfo_array[0]; |
|---|
| 19 | + // PATH_INFO is url-decoded, we need to encode it to match REQUEST_URI |
|---|
| 20 | + $pathinfo = strtolower( urlencode( $pathinfo ) ); |
|---|
| 21 | + $pathinfo = str_replace( '%2f', '/', $pathinfo ); // but not slashes |
|---|
| 22 | + } |
|---|
| 23 | + |
|---|
| 24 | $req_uri = $_SERVER['REQUEST_URI']; |
|---|
| 25 | $req_uri_array = explode('?', $req_uri); |
|---|
| 26 | $req_uri = $req_uri_array[0]; |
|---|