From 9059dc8e88034e74e14fc8227e2aec80e5b8541a Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Tue, 20 Jan 2015 19:13:22 +0000 Subject: [PATCH] `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 --- wp-includes/date.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/date.php b/wp-includes/date.php index 58071d3d3a..a35fada6d1 100644 --- a/wp-includes/date.php +++ b/wp-includes/date.php @@ -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.' ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 74ca6a39f5..c81eb9a329 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.