Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11907 closed defect (bug) (fixed)

invalid permalink structure when %category% is in it

Reported by: universalone's profile universalone Owned by: markjaquith's profile markjaquith
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.1
Component: Canonical Keywords: permalink category
Focuses: Cc:

Description

/%category%/%postname%/ as the permalink structure works and correctly outputs the URL, for example blogurl/category1/postx

BUT if one was to input blogurl/category999/postx into the addressbar, the same postx would show up even if it was NOT in category999, just in category1.

Change History (12)

#1 @scribu
15 years ago

  • Component changed from Permalinks to Canonical
  • Milestone changed from Unassigned to 3.0
  • Owner changed from ryan to markjaquith

Confirmed in WP 3.0-alpha.

I thought this had been fixed in older versions.

#2 follow-up: @dd32
15 years ago

What should be the functionality here, Canonical redirect, or a 404?

I'd be suggesting a redirect myself, as it matches the permalink structure, just wrong item within.

#3 @scribu
15 years ago

+1 on canonical redirect.

#4 @universalone
15 years ago

I agree with a canonical redirect with 301 moved permanently HTTP response.
But why did you assign it to 3.0? Can't it make it into a minor release?

#5 @dd32
15 years ago

But why did you assign it to 3.0? Can't it make it into a minor release?

IMO its not serious enough to go into a 2.9.x maintainence release. Its not stoping any functionality from working, and the link should never be generated by WordPress to start with. So i'd agree with the 3.0 milestone as long as someone patches it :)

#6 in reply to: ↑ 2 @rfair404
15 years ago

Replying to dd32:

What should be the functionality here, Canonical redirect, or a 404?

I'd be suggesting a redirect myself, as it matches the permalink structure, just wrong item within.

I have trunk 12794 running at http://rfair.homelinux.com and I too am seeing this issue - see
http://rfair.homelinux.com/blog/core-development-and-testing/hello-world/

+1 more for canonical

#7 @dd32
15 years ago

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

(In [13781]) Only allow %category% to be a valid category attached to the current post when using %category% in a permalink structure. Fixes #11807

(Sent it to the wrong ticket..)

#8 @jfarthing84
15 years ago

  • Cc jeff@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened

13781 produces a warning when visiting a post within the "Uncategorized" category (possily others, haven't tested).

Specifically:

Warning: in_array() [function.in-array]: Wrong datatype for first argument in E:\wordpress-trunk\wp-includes\canonical.php on line 170

#9 @dd32
15 years ago

13781 produces a warning when visiting a post within the "Uncategorized" category (possily others, haven't tested).

I cant reproduce that myself, However, I'll add some defensive checks to the code just in case.

#10 @dd32
15 years ago

(In [13798]) Add some defensive checks to Canonical redirection of %category% to ensure notices are not thrown. Props jfarthing84 for pointing out possibility. See #11907

Seems that commit notice skiped the ticket.

Can you just check to see if the warnings are still present?

#11 @jfarthing84
15 years ago

I'm not seeing it anymore.

#12 @dd32
15 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.