WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 8 weeks ago

#41933 new defect (bug)

Undefined offset -1 in $pages array when post without pages is requested

Reported by: ComputerGuru Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.2
Component: General Keywords: has-patch
Focuses: Cc:

Description

This patch fixes an undefined index -1 notice generated in post-template.php when a request is made without a page number.

Attachments (2)

0001-Fix-undefined-offset-1-notice-in-pages-array-in-post.patch (1.1 KB) - added by ComputerGuru 9 months ago.
patch
0001-41933-Handle-get_the_content-with-no-pages.patch (1.4 KB) - added by ComputerGuru 8 weeks ago.
Proper patch for root issue

Download all attachments as: .zip

Change History (6)

#1 @ComputerGuru
9 months ago

This is a sample call stack that triggers the notice:

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

This ticket was mentioned in Slack in #core by mte90. View the logs.


3 months ago

#3 @ComputerGuru
8 weeks ago

  • Keywords has-patch added

@ComputerGuru
8 weeks ago

Proper patch for root issue

#4 @ComputerGuru
8 weeks ago

Attached a new patch taking place of the old one, better addressing the root problem.

Note: See TracTickets for help on using tickets.