WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 7 months ago

#39361 new defect (bug)

Object not properly tested against in wp-includes/post-template.php

Reported by: fourstringfail Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: General Keywords: reporter-feedback
Focuses: performance Cc:
PR Number:

Description

PHP Notice: Trying to get property of non-object in /home/coffeet9/public_html/wp-includes/post-template.php on line 298

line 298:

if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) )
$strip_teaser = true;

Requires if(isset($post->post_content)) so that null variables aren't tested against

Change History (1)

#1 @johnbillion
3 years ago

  • Keywords reporter-feedback added

Thanks for the report, @fourstringfail.

Can you tell us in what situation the post_content property would not be set here?

Note: See TracTickets for help on using tickets.