diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php index 9b023e97ec..242b317ca1 100644 --- a/wp-includes/rest-api.php +++ b/wp-includes/rest-api.php @@ -1304,6 +1304,9 @@ function rest_get_avatar_sizes() { /** * Parses an RFC3339 time into a Unix timestamp. * + * Explicitly check for `false` to detect failure, as zero is a valid return + * value on success. + * * @since 4.4.0 * * @param string $date RFC3339 timestamp. @@ -1369,7 +1372,7 @@ function rest_get_date_with_gmt( $date, $is_utc = false ) { $date = rest_parse_date( $date ); - if ( empty( $date ) ) { + if ( false === $date ) { return null; } @@ -2259,7 +2262,7 @@ function rest_validate_value_from_schema( $value, $args, $param = '' ) { break; case 'date-time': - if ( ! rest_parse_date( $value ) ) { + if ( false === rest_parse_date( $value ) ) { return new WP_Error( 'rest_invalid_date', __( 'Invalid date.' ) ); } break; diff --git a/wp-includes/version.php b/wp-includes/version.php index e4dd889496..0547ad31c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59039'; +$wp_version = '6.7-alpha-59040'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.