[wp-trac] [WordPress Trac] #13164: 'Older posts' broken with IIS and Permalinks enabled

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 28 11:44:08 UTC 2010


#13164: 'Older posts' broken with IIS and Permalinks enabled
-----------------------------+----------------------------------------------
 Reporter:  thushanfernando  |       Owner:  ryan      
     Type:  defect (bug)     |      Status:  new       
 Priority:  normal           |   Milestone:  Unassigned
Component:  Permalinks       |     Version:            
 Severity:  normal           |    Keywords:            
-----------------------------+----------------------------------------------
 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.

 {{{
 http://www.thushanfernando.com/index.php/Index.php/page/2
 }}}

 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
 [http://www.thushanfernando.com/index.php/2010/04/28/fix-wordpress-older-
 posts-not-working-in-iis-with-permalinks/ 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13164>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list