Only accept return_url when do_update_woocommerce is present (#48163)
* Accept return_url only when do_update_woocommerce exist * Add changefile(s) from automation for the following project(s): woocommerce * Update 48163-fix-db-update-redirect-issue * Add changefile(s) from automation for the following project(s): woocommerce * Update plugins/woocommerce/changelog/48163-fix-db-update-redirect-issue Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com> * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
This commit is contained in:
parent
22309f0484
commit
d86a90ba9e
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix db update notice redirection bug where it redirects without checking for db update action. </details> <details> <summary>Changelog Entry Comment</summary>
|
|
@ -423,10 +423,11 @@ class WC_Install {
|
||||||
check_admin_referer( 'wc_db_update', 'wc_db_update_nonce' );
|
check_admin_referer( 'wc_db_update', 'wc_db_update_nonce' );
|
||||||
self::update();
|
self::update();
|
||||||
WC_Admin_Notices::add_notice( 'update', true );
|
WC_Admin_Notices::add_notice( 'update', true );
|
||||||
}
|
|
||||||
if ( ! empty( $_GET['return_url'] ) ) { // WPCS: input var ok.
|
if ( ! empty( $_GET['return_url'] ) ) { // WPCS: input var ok.
|
||||||
$return_url = esc_url_raw( wp_unslash( $_GET['return_url'] ) );
|
$return_url = esc_url_raw( wp_unslash( $_GET['return_url'] ) );
|
||||||
wp_safe_redirect( $return_url ); // WPCS: input var ok.
|
wp_safe_redirect( $return_url ); // WPCS: input var ok.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue