Ticket #13753: 13753-make-ref-safe.diff
| File 13753-make-ref-safe.diff, 808 bytes (added by westi, 3 years ago) |
|---|
-
wp-includes/post.php
369 369 wp_cache_add($post->ID, $_post, 'posts'); 370 370 } else { 371 371 if ( is_object($post) ) 372 $post = $post->ID; 373 $post = (int) $post; 374 if ( ! $_post = wp_cache_get($post, 'posts') ) { 375 $_post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post)); 372 $post_id = $post->ID; 373 else 374 $post_id = $post; 375 376 $post_id = (int) $post_id; 377 if ( ! $_post = wp_cache_get($post_id, 'posts') ) { 378 $_post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post_id)); 376 379 if ( ! $_post ) 377 380 return $null; 378 381 _get_post_ancestors($_post);
