Make WordPress Core

Changeset 15770


Ignore:
Timestamp:
10/10/2010 08:02:26 PM (14 years ago)
Author:
scribu
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r15766 r15770  
    261261                $post_type_query_vars[$t->query_var] = $post_type;
    262262
    263         for ( $i = 0; $i < count($this->public_query_vars); $i += 1 ) {
    264             $wpvar = $this->public_query_vars[$i];
    265             if ( isset($this->extra_query_vars[$wpvar]) )
     263        foreach ( $this->public_query_vars as $wpvar ) {
     264            if ( isset( $this->extra_query_vars[$wpvar] ) )
    266265                $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];
    267             elseif ( isset($GLOBALS[$wpvar]) )
     266            elseif ( isset( $GLOBALS[$wpvar] ) )
    268267                $this->query_vars[$wpvar] = $GLOBALS[$wpvar];
    269             elseif ( !empty($_POST[$wpvar]) )
     268            elseif ( isset( $_POST[$wpvar] ) )
    270269                $this->query_vars[$wpvar] = $_POST[$wpvar];
    271             elseif ( !empty($_GET[$wpvar]) )
     270            elseif ( isset( $_GET[$wpvar] ) )
    272271                $this->query_vars[$wpvar] = $_GET[$wpvar];
    273             elseif ( !empty($perma_query_vars[$wpvar]) )
     272            elseif ( isset( $perma_query_vars[$wpvar] ) )
    274273                $this->query_vars[$wpvar] = $perma_query_vars[$wpvar];
    275274
Note: See TracChangeset for help on using the changeset viewer.