mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 07:07:04 +00:00
Rewrite rules: Prevent malformed date requests throwing notices.
Ensure that date queries contain each component before attempting to use them. This prevents http requests triggering notices if a portion of the date is missing. For example a request containing a day and year but no month, a request containing a month bu not year. Props ovidiul, dd32, peterwilsoncc, costdev, johnbillion, SergeyBiryukov, desrosj, tremidkhar, hellofromTonya. Fixes #52252. git-svn-id: https://develop.svn.wordpress.org/trunk@53857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -410,7 +410,10 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) {
|
||||
}
|
||||
|
||||
// This is the potentially clashing slug.
|
||||
$value = $query_vars[ $compare ];
|
||||
$value = '';
|
||||
if ( $compare && array_key_exists( $compare, $query_vars ) ) {
|
||||
$value = $query_vars[ $compare ];
|
||||
}
|
||||
|
||||
$post = get_page_by_path( $value, OBJECT, 'post' );
|
||||
if ( ! ( $post instanceof WP_Post ) ) {
|
||||
|
||||
Reference in New Issue
Block a user