Make WordPress Core

Opened 16 years ago

Closed 15 years ago

Last modified 14 years ago

#10710 closed defect (bug) (fixed)

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

Reported by: filosofo's profile filosofo Owned by: filosofo's profile 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 16 years ago.

Download all attachments as: .zip

Change History (14)

#1 @scribu
16 years ago

  • Cc scribu@… added

#2 @ryan
16 years ago

  • Milestone changed from 2.9 to 3.0

#3 @scribu
15 years ago

Related #11330

#4 @ryan
15 years ago

  • Keywords early added
  • Milestone changed from 3.0 to 3.1

#5 @filosofo
15 years ago

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

#6 @filosofo
15 years ago

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

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

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

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

Thanks for the info.

#12 @scribu
15 years ago

Related: #15112

#13 @ryan
14 years ago

This causes #16002

Note: See TracTickets for help on using tickets.