Skip to content

Commit 5f717ec

Browse files
authored
Fix regex delimiter in date validation
1 parent d02fa79 commit 5f717ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5426,7 +5426,7 @@ function wp_resolve_post_date( $post_date = '', $post_date_gmt = '' ) {
54265426
}
54275427

54285428
// Validate the date.
5429-
preg_match( "/^(?P<year>[0-9]{4})-(?P<month>0[1-9]|1[0-2])-(?P<day>0[1-9]|[1-2][0-9]|3[0-1])/", $post_date, $matches );
5429+
preg_match( '/^(?P<year>[0-9]{4})-(?P<month>0[1-9]|1[0-2])-(?P<day>0[1-9]|[1-2][0-9]|3[0-1])/', $post_date, $matches );
54305430

54315431
if ( empty( $matches ) || ! is_array( $matches ) || count( $matches ) < 4 ) {
54325432
return false;

0 commit comments

Comments
 (0)