'Older posts' broken with IIS and Permalinks enabled
|Reported by:||thushanfernando||Owned by:||ruslany|
|Component:||Permalinks||Keywords:||iis-support has-patch commit|
When Permalinks is enabled under IIS6 the 'Older posts' link generated has an extra Index.php in the link url for page 2 - subsequent pages are OK.
This has been reproduced on a fresh install of WordPress on IIS6 and IIS7 and on multiple WordPress installations.
This has been an issue I've known for a while but only just recently fixed on my own WordPress install on (2.9.2) but I believe its been there since I first looked at v2.
I've hunted the problem down to wp-includes/link-template.php and the function get_pagenum_link which removes any occurrences of index.php in the $request generated URL.
However the regex needs to be case-insensitive so that any Index.php's in the URL (from IIS folks) are also removed.
Fix is simple - and visible on my own blog. Change:
$request = preg_replace( '|^index\.php|', '', $request);
to include case insensitive replace:
$request = preg_replace( '/|^index\.php|/i', '', $request);
I've attached a patch as well.
Change History (17)
comment:7 peaceablewhale — 4 years ago
- Keywords dev-feedback added
- Owner changed from ryan to ruslany
- Status changed from new to reviewing
comment:10 nacin — 3 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release