Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#43463 closed defect (bug) (duplicate)

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

Reported by: computerguru's profile ComputerGuru Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
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 7 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
7 years 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
6 years ago

Probably should be closed in favor of #41933

#3 @pento
6 years ago

  • Milestone 5.0 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #41933.

Note: See TracTickets for help on using tickets.