WordPress.org

Make WordPress Core

Changeset 11406


Ignore:
Timestamp:
05/20/09 16:05:23 (5 years ago)
Author:
ryan
Message:

Remove global regs that can poison query objects. fixes #9854

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r11380 r11406  
    415415        } 
    416416 
    417         $GLOBALS['query_string'] = & $this->query_string; 
     417        $GLOBALS['query_string'] = $this->query_string; 
    418418        $GLOBALS['posts'] = & $wp_query->posts; 
    419         $GLOBALS['post'] = & $wp_query->post; 
    420         $GLOBALS['request'] = & $wp_query->request; 
     419        $GLOBALS['post'] = $wp_query->post; 
     420        $GLOBALS['request'] = $wp_query->request; 
    421421 
    422422        if ( is_single() || is_page() ) { 
  • trunk/wp-includes/query.php

    r11400 r11406  
    7474 */ 
    7575function wp_reset_query() { 
    76     foreach ( array('id', 'authordata', 'day', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages', 'post', 'wp_query') as $var ) 
    77         unset($GLOBALS[$var]); 
     76    unset($GLOBALS['wp_query']); 
    7877    $GLOBALS['wp_query'] =& $GLOBALS['wp_the_query']; 
    7978    global $wp_query; 
     
    23762375     */ 
    23772376    function the_post() { 
    2378         unset($GLOBALS['post']); // Break the ref 
    23792377        global $post; 
    23802378        $this->in_the_loop = true; 
    23812379        $post = $this->next_post(); 
    23822380        setup_postdata($post); 
    2383         do_action('the_post', $post); 
    23842381 
    23852382        if ( $this->current_post == 0 ) // loop has just started 
     
    26502647 * 
    26512648 * @param object $post Post data. 
     2649 * @uses do_action_ref_array() Calls 'the_post' 
    26522650 * @return bool True when finished. 
    26532651 */ 
     
    26552653    global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages; 
    26562654 
     2655    do_action_ref_array('the_post', array(&$post)); 
     2656     
    26572657    $id = (int) $post->ID; 
    26582658 
Note: See TracChangeset for help on using the changeset viewer.