WordPress.org

Make WordPress Core

Ticket #52252: 52252.patch

File 52252.patch, 571 bytes (added by ovidiul, 7 weeks ago)

adding array_key_exists check

  • src/wp-includes/rewrite.php

    diff --git a/src/wp-includes/rewrite.php b/src/wp-includes/rewrite.php
    index 4a204c2601..b35dcabf42 100644
    a b function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) { 
    410410        }
    411411
    412412        // This is the potentially clashing slug.
    413         $value = $query_vars[ $compare ];
     413        $value = '';
     414        if ( $compare && array_key_exists( $compare, $query_vars ) ) {
     415                $value = $query_vars[ $compare ];
     416        }
    414417
    415418        $post = get_page_by_path( $value, OBJECT, 'post' );
    416419        if ( ! ( $post instanceof WP_Post ) ) {