Ticket #6650 (closed defect (bug): fixed)

Opened 4 years ago

Last modified 4 years ago

PATHINFO permalinks structure broken in 2.5

Reported by: dlo Owned by: ryan
Priority: highest omg bbq Milestone: 2.5.1
Component: General Version: 2.5
Severity: blocker Keywords: page permalink pathinfo rewrite.php
Cc:

Description

The PATHINFO permalink structure /index.php/%category%/%postname%/ leads to a "page not found" error when clicking on a page URL (but not on a post or category URL).

It seems that PATHINFO permalink structure beginning with /index.php/%category% or /index.php/%postname% or /index.php/%tag% or /index.php/%author% is broken for pages in WP 2.5 when it was valid in WP 2.3.3.

To get access to the pages, you have to change the PATHINFO permalink to /index.php/%year%/%category%/%postname%/, for instance.

Attachments

rewrite.php Download (33.6 KB) - added by dlo 4 years ago.
Corrected rewrite.php for PATHINFO permalinks

Change History

comment:1   dlo4 years ago

It looks like I found the solution:

Add a test in init() function of wp-includes/rewrite.php to check if we're using PATHINFO permalinks and thus, generate verbose page permalinks.

Code snippet:

if ( 0 === strpos($structure, '%postname%') ||
			 0 === strpos($structure, '%category%') ||
			 0 === strpos($structure, '%tag%') ||
			 0 === strpos($structure, '%author%') ||
				$this->using_index_permalinks() )
			 $this->use_verbose_page_rules = true;
		else
			$this->use_verbose_page_rules = false;

dlo4 years ago

Corrected rewrite.php for PATHINFO permalinks

comment:2   dlo4 years ago

  • Keywords page permalink pathinfo rewrite.php added

comment:3   dlo4 years ago

  • Summary changed from /index.php/%category%/%postname%/ permalink broken in 2.5 to PATHINFO permalinks structure broken in 2.5

comment:4   ryan4 years ago

  • Owner changed from anonymous to ryan

comment:5   ryan4 years ago

  • Status changed from new to closed
  • Resolution set to fixed

(In [7665]) Handle pathinfo structures when determining if verbose page rules should be used. Props dlo. fixes #6650 #6570 for trunk

comment:6   ryan4 years ago

(In [7666]) Handle pathinfo structures when determining if verbose page rules should be used. Props dlo. fixes #6650 #6570 for 2.5

Note: See TracTickets for help on using tickets.