Opened 8 years ago
Last modified 6 years ago
#41933 new defect (bug)
Undefined offset -1 in $pages array when post without pages is requested
Reported by: |
|
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)
Change History (12)
#1
@
8 years 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.
7 years ago
#4
@
7 years ago
Attached a new patch taking place of the old one, better addressing the root problem.
#6
@
7 years ago
Hi @ComputerGuru
It's always risky to trust global variables, as plugins and themes can override it.
Can we reproduce this notice on a vanilla install (default theme and no installed plugins) ?
What steps should we take to reproduce it?
#8
@
6 years ago
@birgire it doesn't reproduce on a clean installation, only with JetPack installed and enabled.
Note: See
TracTickets for help on using
tickets.
patch