Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#47392 closed defect (bug) (fixed)

Update date_query condition to verify param data in proper order

Reported by: vishalkakadiya's profile vishalkakadiya Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Date/Time Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Here the code is doing something that it's using array values like $date_query['relation'] first then it's checking for ! is_array which looking not proper and also we are checking empty value late so I have updated them in this PR.

Let me know if any other changes needed here. Thanks!

Attachments (1)

47392.diff (1.0 KB) - added by vishalkakadiya 4 years ago.

Download all attachments as: .zip

Change History (7)

@vishalkakadiya
4 years ago

#1 @mukesh27
4 years ago

  • Component changed from General to Date/Time
  • Version trunk deleted

@vishalkakadiya good cache. i have tested above patch it working fine for me.

@desrosj can you please check it.

This ticket was mentioned in Slack in #core-datetime by rarst. View the logs.


4 years ago

#3 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.3
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
4 years ago

Introduced in [29923].

#5 @SergeyBiryukov
4 years ago

  • Description modified (diff)

#6 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 45850:

Date/Time: In WP_Date_Query::__construct(), return early if $date_query is empty or not an array.

Props vishalkakadiya.
Fixes #47392.

Note: See TracTickets for help on using tickets.