WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 9 years ago

#10710 closed defect (bug) (fixed)

parse_request() of WP should set empty query variables when appropriate

Reported by: filosofo Owned by: filosofo
Milestone: 3.1 Priority: normal
Severity: normal Version: 2.9
Component: Permalinks Keywords: has-patch early
Focuses: Cc:

Description

As scribu points out, if a custom query variable is empty it remains unset.

Patch changes the empty check on permalink variables to an isset check.

This shouldn't affect core query variables, because it seems as though they're eventually all set even when empty.

Attachments (1)

allow_empty_permalink_vars.10710.diff (543 bytes) - added by filosofo 11 years ago.

Download all attachments as: .zip

Change History (14)

#1 @scribu
11 years ago

  • Cc scribu@… added

#2 @ryan
10 years ago

  • Milestone changed from 2.9 to 3.0

#3 @scribu
10 years ago

Related #11330

#4 @ryan
10 years ago

  • Keywords early added
  • Milestone changed from 3.0 to 3.1

#5 @filosofo
10 years ago

  • Keywords parse_request removed
  • Milestone changed from Awaiting Triage to 3.1

#6 @filosofo
10 years ago

  • Owner changed from ryan to filosofo
  • Status changed from new to accepted

#7 @filosofo
10 years ago

Another reason for this is that when endpoint rewrite rules are generated, they explicitly allow for empty endpoint values (see line 1289ff of wp-includes/rewrite.php).

So WP rewrite is writing checks that WP query can't cash.

#8 @scribu
10 years ago

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

(In [15770]) Make parse_reques() set empty variables. Props filosofo for initial patch. Fixes #10710

#9 follow-up: @scribu
10 years ago

PS: I have no idea why elseif ( isset( $GLOBALS[$wpvar] ) ) is there.

#10 in reply to: ↑ 9 @hakre
10 years ago

Replying to scribu:

PS: I have no idea why elseif ( isset( $GLOBALS[$wpvar] ) ) is there.

That's a feature so that plugins can re-enable register globals functionality.

#11 @scribu
10 years ago

Thanks for the info.

#12 @scribu
9 years ago

Related: #15112

#13 @ryan
9 years ago

This causes #16002

Note: See TracTickets for help on using tickets.