Fixed the jetpack redirect url for sites in subdirectories (#17312)

* Fixed the jetpack redirect url for sites in subdirectories

* Using admin_url instead of get_admin_url for consistency

* Wrapped the generated url in esc_url_raw
This commit is contained in:
Marcin Bot 2017-10-26 13:40:54 +01:00 committed by Mike Jolley
parent 9c2df6486c
commit 234d9e05a5
1 changed files with 4 additions and 2 deletions

View File

@ -1582,10 +1582,12 @@ class WC_Admin_Setup_Wizard {
exit;
}
$redirect_url = site_url( add_query_arg( array(
$redirect_url = esc_url_raw( add_query_arg( array(
'page' => 'wc-setup',
'step' => 'activate',
'from' => 'wpcom',
'activate_error' => false,
) ) );
), admin_url() ) );
$connection_url = Jetpack::init()->build_connect_url( true, $redirect_url, 'woocommerce-setup-wizard' );
wp_redirect( esc_url_raw( $connection_url ) );