From 44116d4b724e4eb48b30ce9fe059f2035dd7a2fe Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Sat, 6 Dec 2014 02:29:24 +0000 Subject: [PATCH] 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 --- 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 fc6c71aff4..9d59866511 100644 --- a/wp-includes/date.php +++ b/wp-includes/date.php @@ -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 %1$d, day %2$d.' ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 03f3036ab3..39e3d2385f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.