Make WordPress Core

Ticket #56311: 56311.diff

File 56311.diff, 799 bytes (added by domainsupport, 21 months ago)
  • src/wp-includes/class-wp-date-query.php

     
    384384                        'max' => 59,
    385385                );
    386386
     387                $date_variable_keys = array(
     388                        'month' => 'monthnum',
     389                        'week' => 'w',
     390                        'day' => 'day',
     391                        'hour' => 'hour',
     392                        'minute' => 'minute',
     393                        'second' => 'second'
     394                );
     395
    387396                // Concatenate and throw a notice for each invalid value.
    388397                foreach ( $min_max_checks as $key => $check ) {
    389                         if ( ! array_key_exists( $key, $date_query ) ) {
     398                        if (
     399                                ( isset($date_variable_keys[$key]) && isset($_GET[$date_variable_keys[$key]]) ) ||
     400                                ! array_key_exists( $key, $date_query )
     401                        ) {
    390402                                continue;
    391403                        }
    392404