Make WordPress Core

Changeset 36064


Ignore:
Timestamp:
12/23/2015 01:41:24 AM (9 years ago)
Author:
dd32
Message:

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

Merges [35994] to the 4.4 branch.
Props igmoweb, swissspidy.
Fixes #35013.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-includes/class-wp.php

    r36035 r36064  
    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.