[wp-trac] [WordPress Trac] #57272: Bug in main query
WordPress Trac
noreply at wordpress.org
Mon Dec 5 14:22:19 UTC 2022
#57272: Bug in main query
-----------------------------------------+------------------------------
Reporter: brahimwpk | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.1.1
Severity: normal | Resolution:
Keywords: has-patch reporter-feedback | Focuses:
-----------------------------------------+------------------------------
Changes (by johnbillion):
* keywords: has-patch => has-patch reporter-feedback
Old description:
> Hello community,
>
> After a days of debugging i found a bug in wordpress core related to
> query var 'm', in the case that allows to get posts of a month.
>
> wp-includes/class-wp-query.php in this bloc
>
> if ( $q['m'] ) {
> if(strlen( $q['m'] ) == 6){
>
> i changed the where statement :
>
> $where .= " AND {$wpdb->posts}.post_date <= '$end_date' AND
> {$wpdb->posts}.post_date >= '$start_date' ";
>
> to :
>
> $where .= " AND {$wpdb->posts}.post_date <= '$end_date 23:59:59' AND
> {$wpdb->posts}.post_date >= '$start_date' ";
New description:
Hello community,
After a days of debugging i found a bug in wordpress core related to query
var 'm', in the case that allows to get posts of a month.
wp-includes/class-wp-query.php in this bloc
{{{#!php
<?php
if ( $q['m'] ) {
if(strlen( $q['m'] ) == 6){
}}}
i changed the where statement :
{{{#!php
<?php
$where .= " AND {$wpdb->posts}.post_date <= '$end_date' AND
{$wpdb->posts}.post_date >= '$start_date' ";
}}}
to :
{{{#!php
<?php
$where .= " AND {$wpdb->posts}.post_date <= '$end_date 23:59:59' AND
{$wpdb->posts}.post_date >= '$start_date' ";
}}}
--
Comment:
Thanks for the report @brahimwpk . What's the actual bug you're seeing
please?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57272#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list