Ticket #21309: 21309.12.diff

File 21309.12.diff, 625 bytes (added by ryan, 7 months ago)

Patch the symptom

Line 
1Index: wp-includes/post.php
2===================================================================
3--- wp-includes/post.php        (revision 22145)
4+++ wp-includes/post.php        (working copy)
5@@ -3494,7 +3494,7 @@
6        $cache = array();
7        $key = md5( serialize( compact(array_keys($defaults)) ) );
8        if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) {
9-               if ( is_array($cache) && isset( $cache[ $key ] ) ) {
10+               if ( is_array($cache) && isset( $cache[ $key ] ) && is_array( $cache[ $key ] ) ) {
11                        // Convert to WP_Post instances
12                        $pages = array_map( 'get_post', $cache[ $key ] );
13                        $pages = apply_filters( 'get_pages', $pages, $r );