WP_Date_Query date validation should not fail for hour = 0.

Props ChriCo, tyxla.
Merges [31251] to the 4.1 branch.
Fixes #31067.

Built from https://develop.svn.wordpress.org/branches/4.1@31377


git-svn-id: http://core.svn.wordpress.org/branches/4.1@31358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2015-02-09 02:33:22 +00:00
parent ab103b5bf9
commit 93cf0191c3

View File

@ -360,7 +360,7 @@ class WP_Date_Query {
// Hours per day.
$min_max_checks['hour'] = array(
'min' => 1,
'min' => 0,
'max' => 23
);
@ -384,7 +384,7 @@ class WP_Date_Query {
$is_between = $date_query[ $key ] >= $check['min'] && $date_query[ $key ] <= $check['max'];
if ( ! $is_between ) {
if ( ! is_numeric( $date_query[ $key ] ) || ! $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 */