Customizer: Prevent erroneously directing user to login screen when closing.
Fixes issue where user gets stuck at login screen after trying to close the app if previously they had to first login to access the Customizer. Prevents `WP_Customize_Manager::get_return_url()` from using `wp-login.php` as a referer. Props chandrapatel. See #32637. Fixes #35355. Built from https://develop.svn.wordpress.org/trunk@36261 git-svn-id: http://core.svn.wordpress.org/trunk@36228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1579,9 +1579,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;
|
||||
|
||||
Reference in New Issue
Block a user