`WP_Date_Query` date validation should not fail for hour = 0.
Props ChriCo, tyxla. Fixes #31067 for trunk. Built from https://develop.svn.wordpress.org/trunk@31251 git-svn-id: http://core.svn.wordpress.org/trunk@31232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
17f69a89d4
commit
9059dc8e88
|
@ -368,7 +368,7 @@ class WP_Date_Query {
|
|||
|
||||
// Hours per day.
|
||||
$min_max_checks['hour'] = array(
|
||||
'min' => 1,
|
||||
'min' => 0,
|
||||
'max' => 23
|
||||
);
|
||||
|
||||
|
@ -394,7 +394,7 @@ class WP_Date_Query {
|
|||
foreach ( (array) $date_query[ $key ] as $_value ) {
|
||||
$is_between = $_value >= $check['min'] && $_value <= $check['max'];
|
||||
|
||||
if ( ! $is_between ) {
|
||||
if ( ! is_numeric( $_value ) || ! $is_between ) {
|
||||
$error = sprintf(
|
||||
/* translators: Date query invalid date message: 1: invalid value, 2: type of value, 3: minimum valid value, 4: maximum valid value */
|
||||
__( 'Invalid value %1$s for %2$s. Expected value should be between %3$s and %4$s.' ),
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31250';
|
||||
$wp_version = '4.2-alpha-31251';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue