[wp-trac] [WordPress Trac] #46828: Undefined Offset -1 in wp-includes/rewrite.php on lines 379 and 381
WordPress Trac
noreply at wordpress.org
Mon Apr 8 03:59:47 UTC 2019
#46828: Undefined Offset -1 in wp-includes/rewrite.php on lines 379 and 381
--------------------------+------------------------------
Reporter: thomstark | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by thomstark):
My second (last) bugfix has an error of its own, an extra closing
parenthesis. Here's the fix to that:
{{{#!php
<?php
if ( 0 === $postname_index) {
if( isset( $query_vars['year'] ) || isset( $query_vars['monthnum'] ) )
{
$compare = 'year';
}
}
else {
if ('%year%' === $permastructs[ $postname_index - 1 ] && ( isset(
$query_vars['monthnum'] ) || isset( $query_vars['day'] ) ) ) {
$compare = 'monthnum';
} elseif ('%monthnum%' === $permastructs[ $postname_index - 1 ] &&
isset( $query_vars['day'] ) ) {
$compare = 'day';
}
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46828#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list