WordPress 4.4.2
[autoinstalls/wordpress.git] / wp-includes / class-wp-customize-manager.php
index 9f15d31f577149c4d546e16530e54c4206e2cd3c..b789556393275608b09da8c367dc6566ac2b62a7 100644 (file)
@@ -1535,9 +1535,11 @@ final class WP_Customize_Manager {
         */
        public function get_return_url() {
                $referer = wp_get_referer();
+               $excluded_referer_basenames = array( 'customize.php', 'wp-login.php' );
+
                if ( $this->return_url ) {
                        $return_url = $this->return_url;
-               } else if ( $referer && 'customize.php' !== basename( parse_url( $referer, PHP_URL_PATH ) ) ) {
+               } else if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) {
                        $return_url = $referer;
                } else if ( $this->preview_url ) {
                        $return_url = $this->preview_url;