Make WordPress Core

Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#10710 closed defect (bug) (fixed)

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

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

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 17 years ago.

Download all attachments as: .zip

Change History (14)

#1 @scribu
17 years ago

  • Cc scribu@… added

#2 @ryan
17 years ago

  • Milestone 2.9 → 3.0

#3 @scribu
17 years ago

Related #11330

#4 @ryan
16 years ago

  • Keywords early added
  • Milestone 3.0 → 3.1

#5 @filosofo
16 years ago

  • Keywords parse_request removed
  • Milestone Awaiting Triage → 3.1

#6 @filosofo
16 years ago

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

#7 @filosofo
16 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
16 years ago

  • Resolution → fixed
  • Status accepted → closed

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

#9 follow-up: @scribu
16 years ago

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

#10 in reply to: ↑ 9 @hakre
16 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
16 years ago

Thanks for the info.

#12 @scribu
16 years ago

Related: #15112

#13 @ryan
16 years ago

This causes #16002

Note: See TracTickets for help on using tickets.