Make WordPress Core


Ignore:
Timestamp:
10/19/2009 09:28:44 PM (15 years ago)
Author:
ryan
Message:

Improve sanitize_post() performance. Perform raw filtering only once. Add filter check to eliminate double filtering. Props johanee. fixes #10972 see #10801

File:
1 edited

Legend:

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

    r12052 r12062  
    23612361            $this->posts = apply_filters('the_posts', $this->posts);
    23622362
     2363        $this->post_count = count($this->posts);
     2364
     2365        // Sanitize before caching so it'll only get done once
     2366        for ($i = 0; $i < $this->post_count; $i++) {
     2367            $this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
     2368        }
     2369
    23632370        update_post_caches($this->posts);
    23642371
    2365         $this->post_count = count($this->posts);
    23662372        if ($this->post_count > 0) {
    23672373            $this->post = $this->posts[0];
Note: See TracChangeset for help on using the changeset viewer.