[wp-trac] [WordPress Trac] #23074: Changing post's URL and then setting it back causes redirect loop (wp_old_slug_redirect) (was: Changing post's URL and then setting it back causes redirect loop)

WordPress Trac noreply at wordpress.org
Wed Feb 5 02:41:43 UTC 2014


#23074: Changing post's URL and then setting it back causes redirect loop
(wp_old_slug_redirect)
-----------------------------------+-----------------------
 Reporter:  vbuterin               |       Owner:
     Type:  defect (bug)           |      Status:  reopened
 Priority:  normal                 |   Milestone:
Component:  Canonical              |     Version:  3.5
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+-----------------------
Changes (by kitchin):

 * keywords:   => has-patch 2nd-opinion
 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 Here is how to reproduce. It may seem like a corner case, but I advocate
 fixing it (patch attached) because
 1. It hard to debug.
 2. Docs and forum support for redirect loops (on custom post types) are
 all about calling `flush_rewrite_rules()` correctly, an unrelated issue.

 Steps to reproduce (with permalinks set):
 1. create a post 'foo'
 2. change the permalink to 'foobar'
 3. make the post Private
 4. change the permalink back to 'foo'
 5. open the post in non-logged-in browser
 6. result: redirect loop notice (or blank screen depending on browser)


 Minimal fix attached. It's a one line SQL clause to prevent an obvious
 redirect loop in `wp_old_slug_redirect()`.

 ''Hope it's OK if I change the keywords and resolution here. I can't
 change the version, but it affects 3.8.1 and trunk has the same code.''

--
Ticket URL: <https://core.trac.wordpress.org/ticket/23074#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list