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

git-svn-id: https://develop.svn.wordpress.org/trunk@15770 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu 2010-10-10 20:02:26 +00:00
parent e47fb410bc
commit 6e89ca7bff
1 changed files with 6 additions and 7 deletions

View File

@ -260,17 +260,16 @@ class WP {
if ( $t->query_var ) if ( $t->query_var )
$post_type_query_vars[$t->query_var] = $post_type; $post_type_query_vars[$t->query_var] = $post_type;
for ( $i = 0; $i < count($this->public_query_vars); $i += 1 ) { foreach ( $this->public_query_vars as $wpvar ) {
$wpvar = $this->public_query_vars[$i]; if ( isset( $this->extra_query_vars[$wpvar] ) )
if ( isset($this->extra_query_vars[$wpvar]) )
$this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar]; $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];
elseif ( isset($GLOBALS[$wpvar]) ) elseif ( isset( $GLOBALS[$wpvar] ) )
$this->query_vars[$wpvar] = $GLOBALS[$wpvar]; $this->query_vars[$wpvar] = $GLOBALS[$wpvar];
elseif ( !empty($_POST[$wpvar]) ) elseif ( isset( $_POST[$wpvar] ) )
$this->query_vars[$wpvar] = $_POST[$wpvar]; $this->query_vars[$wpvar] = $_POST[$wpvar];
elseif ( !empty($_GET[$wpvar]) ) elseif ( isset( $_GET[$wpvar] ) )
$this->query_vars[$wpvar] = $_GET[$wpvar]; $this->query_vars[$wpvar] = $_GET[$wpvar];
elseif ( !empty($perma_query_vars[$wpvar]) ) elseif ( isset( $perma_query_vars[$wpvar] ) )
$this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; $this->query_vars[$wpvar] = $perma_query_vars[$wpvar];
if ( !empty( $this->query_vars[$wpvar] ) ) { if ( !empty( $this->query_vars[$wpvar] ) ) {