WordPress.org

Make WordPress Core

Ticket #35355: 35355.patch

File 35355.patch, 845 bytes (added by chandrapatel, 5 years ago)

Exclude login page from referer page in customizer.

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

     
    15791579         */
    15801580        public function get_return_url() {
    15811581                $referer = wp_get_referer();
     1582
     1583                //Exclude following files from referer.
     1584                $exclude_referer = array( 'customize.php', 'wp-login.php' );
     1585
    15821586                if ( $this->return_url ) {
    15831587                        $return_url = $this->return_url;
    1584                 } else if ( $referer && 'customize.php' !== basename( parse_url( $referer, PHP_URL_PATH ) ) ) {
     1588                } else if ( $referer && !in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $exclude_referer ) ) {
    15851589                        $return_url = $referer;
    15861590                } else if ( $this->preview_url ) {
    15871591                        $return_url = $this->preview_url;