mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-06 05:34:26 +00:00
Posting: Improve the invalid date protection code based on feedback from nacin.
* Introduce a wp_checkdate() function with a single filter to centralise the code that validates dates. * Improve the error message * Correctly handle the return value of wp_insert_post which is not always a WP_Error on failure Fixes #17180 git-svn-id: https://develop.svn.wordpress.org/trunk@21922 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3703,3 +3703,13 @@ function _device_can_upload() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if the supplied date is valid for the Gregorian calendar
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @return bool true|false
|
||||
*/
|
||||
function wp_checkdate( $month, $day, $year, $source_date ) {
|
||||
return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date );
|
||||
}
|
||||
Reference in New Issue
Block a user