WordPress.org

Make WordPress Core

Changeset 22238


Ignore:
Timestamp:
10/15/12 20:42:57 (18 months ago)
Author:
ryan
Message:

Replace the sanitize loop at the end of WP_Query::get_posts() with an array_map of get_post(). get_post() will ensure each object in the loop is sanitized and is of the type WP_Post. see #22162

File:
1 edited

Legend:

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

    r22011 r22238  
    27752775        $this->post_count = count( $this->posts ); 
    27762776 
    2777         // Always sanitize 
    2778         foreach ( $this->posts as $i => $post ) { 
    2779             $this->posts[$i] = sanitize_post( $post, 'raw' ); 
    2780         } 
     2777        // Ensure that any posts added/modified via one of the filters above are 
     2778        // of the type WP_Post and are filtered. 
     2779        if ( $this->posts ) 
     2780            $this->posts = array_map( 'get_post', $this->posts ); 
    27812781 
    27822782        if ( $q['cache_results'] ) 
Note: See TracChangeset for help on using the changeset viewer.