WordPress.org

Make WordPress Core

Changeset 35994


Ignore:
Timestamp:
12/17/2015 06:12:50 PM (4 years ago)
Author:
swissspidy
Message:

In WP::handle_404(), make sure $wp_query->post is a WP_Post object before cloning it.

Props igmoweb for initial patch.
See #35013.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp.php

    r35848 r35994  
    610610            $success = true;
    611611            if ( is_singular() ) {
    612                 $p = clone $wp_query->post;
     612                $p = false;
     613
     614                if ( $wp_query->post instanceof WP_Post ) {
     615                    $p = clone $wp_query->post;
     616                }
     617
    613618                // Only set X-Pingback for single posts that allow pings.
    614619                if ( $p && pings_open( $p ) ) {
Note: See TracChangeset for help on using the changeset viewer.