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

Props igmoweb for initial patch.
See #35013.
Built from https://develop.svn.wordpress.org/trunk@35994


git-svn-id: http://core.svn.wordpress.org/trunk@35959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2015-12-17 18:13:29 +00:00
parent 9572878fab
commit 7b6c596e92
2 changed files with 7 additions and 2 deletions

View File

@ -609,7 +609,12 @@ class WP {
$success = true; $success = true;
if ( is_singular() ) { if ( is_singular() ) {
$p = false;
if ( $wp_query->post instanceof WP_Post ) {
$p = clone $wp_query->post; $p = clone $wp_query->post;
}
// Only set X-Pingback for single posts that allow pings. // Only set X-Pingback for single posts that allow pings.
if ( $p && pings_open( $p ) ) { if ( $p && pings_open( $p ) ) {
@header( 'X-Pingback: ' . get_bloginfo( 'pingback_url' ) ); @header( 'X-Pingback: ' . get_bloginfo( 'pingback_url' ) );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-alpha-35993'; $wp_version = '4.5-alpha-35994';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.