WordPress.org

Make WordPress Core

Ticket #41224: 41224.patch

File 41224.patch, 962 bytes (added by Girishpanchal, 2 years ago)

Patch added #41224

  • src/wp-includes/class-wp.php

     
    270270                        }
    271271
    272272                        // If req_uri is empty or if it is a request for ourself, unset error.
    273                         if ( empty($requested_path) || $requested_file == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) {
     273                        if ( empty( $requested_path ) || $requested_file == $self || strpos( $_SERVER['PHP_SELF'], 'wp-admin/' ) !== false ) {
    274274                                unset( $error, $_GET['error'] );
    275275
    276                                 if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false )
     276                                // If isset perma_query_vars and found url "wp-admin/" from the administrative interface page.
     277                                if ( isset( $perma_query_vars ) && strpos( $_SERVER['PHP_SELF'], 'wp-admin/' ) !== false && is_admin() )
    277278                                        unset( $perma_query_vars );
    278279
    279280                                $this->did_permalink = false;