WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 8 weeks ago

#43463 new defect (bug)

defect: blind access of possibly negative of $pages in get_the_content

Reported by: ComputerGuru Owned by:
Milestone: 5.0 Priority: normal
Severity: normal Version: trunk
Component: Posts, Post Types Keywords: has-patch
Focuses: template Cc:

Description

Attached patch addresses PHP notices caused when JetPack OG is installed on a theme with header.php calling get_header() as the first action before $page is defined.

Stack trace of notice:

get_header()
wp-content/themes/knowhow/page.php:1
locate_template()
wp-includes/general-template.php:41
load_template('~/wp-content/themes/knowhow/header.php')
wp-includes/template.php:647
wp_head()
wp-content/themes/knowhow/header.php:14
do_action('wp_head')
wp-includes/general-template.php:2614
jetpack_og_tags()
wp-includes/class-wp-hook.php:286
apply_filters('jetpack_open_graph_tags')
wp-content/plugins/jetpack/functions.opengraph.php:216
enhanced_og_image()
wp-includes/class-wp-hook.php:288
Jetpack_Media_Summary::get()
wp-content/plugins/jetpack/modules/publicize/enhanced-open-graph.php:23
Jetpack_Media_Summary::get_excerpt()
wp-content/plugins/jetpack/_inc/lib/class.media-summary.php:57
apply_filters('get_the_excerpt')
wp-content/plugins/jetpack/_inc/lib/class.media-summary.php:314
wp_trim_excerpt()
wp-includes/class-wp-hook.php:286
get_the_content()
wp-includes/formatting.php:3308

Attachments (1)

0001-Handle-negative-page-indexes-in-get_the_content.patch (976 bytes) - added by ComputerGuru 4 months ago.

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
4 months ago

  • Component changed from General to Posts, Post Types
  • Focuses template added
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 5.0

#2 @ComputerGuru
8 weeks ago

Probably should be closed in favor of #41933

Note: See TracTickets for help on using tickets.