Use wp_checkdate() when checking date validity in WP_Date_Query.

See #25834.
Built from https://develop.svn.wordpress.org/trunk@30750


git-svn-id: http://core.svn.wordpress.org/trunk@30740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2014-12-06 02:29:24 +00:00
parent 79eb593440
commit 44116d4b72
2 changed files with 3 additions and 3 deletions

View File

@ -414,7 +414,7 @@ class WP_Date_Query {
if ( $day_exists && $month_exists && $year_exists ) {
// 1. Checking day, month, year combination.
if ( ! checkdate( $date_query['month'], $date_query['day'], $date_query['year'] ) ) {
if ( ! wp_checkdate( $date_query['month'], $date_query['day'], $date_query['year'], sprintf( '%s-%s-%s', $date_query['year'], $date_query['month'], $date_query['day'] ) ) ) {
/* translators: 1: year, 2: month, 3: day of month */
$day_month_year_error_msg = sprintf(
__( 'The following values do not describe a valid date: year %1$s, month %2$s, day %3$s.' ),
@ -431,7 +431,7 @@ class WP_Date_Query {
* 2. checking day, month combination
* We use 2012 because, as a leap year, it's the most permissive.
*/
if ( ! checkdate( $date_query['month'], $date_query['day'], 2012 ) ) {
if ( ! wp_checkdate( $date_query['month'], $date_query['day'], 2012, sprintf( '2012-%s-%s', $date_query['month'], $date_query['day'] ) ) ) {
/* translators: 1: month, 2: day of month */
$day_month_year_error_msg = sprintf(
__( 'The following values do not describe a valid date: month <code>%1$d</code>, day <code>%2$d</code>.' ),

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-beta2-30749';
$wp_version = '4.1-beta2-30750';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.