mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
Avoid refetching a post in get_post() when passed a post object that has already been raw sanitized. Clean up sanitize loop. Props scribu. fixes #18822
git-svn-id: https://develop.svn.wordpress.org/trunk@18846 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2745,9 +2745,9 @@ class WP_Query {
|
||||
|
||||
$this->post_count = count($this->posts);
|
||||
|
||||
// Sanitize before caching so it'll only get done once
|
||||
for ( $i = 0; $i < $this->post_count; $i++ ) {
|
||||
$this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
|
||||
// Always sanitize
|
||||
foreach ( $this->posts as $i => $post ) {
|
||||
$this->posts[$i] = sanitize_post( $post, 'raw' );
|
||||
}
|
||||
|
||||
if ( $q['cache_results'] )
|
||||
|
||||
Reference in New Issue
Block a user