[wp-trac] [WordPress Trac] #43056: Notice in redirect_guess_404_permalink() when post type is an array
WordPress Trac
noreply at wordpress.org
Fri Jul 31 05:56:22 UTC 2020
#43056: Notice in redirect_guess_404_permalink() when post type is an array
--------------------------+---------------------
Reporter: junaidbhura | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.6
Component: Canonical | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+---------------------
Comment (by peterwilsoncc):
I've taken a look at [attachment:"43056.2.diff"]
The escaping looks good with `esc_url`, the post types are verified as
legitimate in `class-wp.php`.
You'll notice that at the moment, the canonical guess function uses
`get_query_var( 'post_type' )` calls multiple times. This is to act as a
safety switch so that the value of a variable isn't changed by mistake --
this can lead to problems ;)
Rather than putting the value in a variable, I think calling
`get_query_var( 'post_type' )` each time would an improvement.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43056#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list