Make WordPress Core

Ticket #39881: 39881.patch

File 39881.patch, 647 bytes (added by GhostToast, 9 years ago)

Check if parent exists before using it

  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

     
    12891289                // Can we read the parent if we're inheriting?
    12901290                if ( 'inherit' === $post->post_status && $post->post_parent > 0 ) {
    12911291                        $parent = get_post( $post->post_parent );
    1292                         return $this->check_read_permission( $parent );
     1292                        if ( $parent ) {
     1293                                return $this->check_read_permission( $parent );
     1294                        }
    12931295                }
    12941296
    12951297                /*