From 93cf0191c3073e1b2e970ea3373f25b5d75e7d9c Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 9 Feb 2015 02:33:22 +0000 Subject: [PATCH] `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 --- wp-includes/date.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/date.php b/wp-includes/date.php index 51c5d84b9d..daa218fc90 100644 --- a/wp-includes/date.php +++ b/wp-includes/date.php @@ -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 */