mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
redirect when POST request with the error-get-parameter, so no error message will be shown later on
This commit is contained in:
parent
951092558d
commit
d9b2818685
2 changed files with 17 additions and 4 deletions
|
@ -168,6 +168,12 @@ class SettingsListener {
|
||||||
$this->cache->delete( PayPalBearer::CACHE_KEY );
|
$this->cache->delete( PayPalBearer::CACHE_KEY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( isset( $_GET['ppcp-onboarding-error'] ) ) {
|
||||||
|
$url = remove_query_arg( 'ppcp-onboarding-error' );
|
||||||
|
wp_safe_redirect( $url, 302 );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// phpcs:enable WordPress.Security.NonceVerification.Missing
|
// phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||||
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,10 +98,14 @@ class SettingsRenderer {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function messages() : array {
|
public function messages() : array {
|
||||||
//phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
|
||||||
if ( ! isset( $_GET['ppcp-onboarding-error'] ) ) {
|
//phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||||
|
//phpcs:disable WordPress.Security.NonceVerification.Missing
|
||||||
|
if ( ! isset( $_GET['ppcp-onboarding-error'] ) || ! empty( $_POST ) ) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
//phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||||
|
//phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||||
|
|
||||||
$messages = array(
|
$messages = array(
|
||||||
new Message(
|
new Message(
|
||||||
|
@ -250,9 +254,12 @@ class SettingsRenderer {
|
||||||
*/
|
*/
|
||||||
public function render() {
|
public function render() {
|
||||||
|
|
||||||
//phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
//phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||||
|
//phpcs:disable WordPress.Security.NonceVerification.Missing
|
||||||
$is_dcc = isset( $_GET[ SectionsRenderer::KEY ] ) && CreditCardGateway::ID === sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) );
|
$is_dcc = isset( $_GET[ SectionsRenderer::KEY ] ) && CreditCardGateway::ID === sanitize_text_field( wp_unslash( $_GET[ SectionsRenderer::KEY ] ) );
|
||||||
$nonce = wp_create_nonce( SettingsListener::NONCE );
|
//phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||||
|
//phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||||
|
$nonce = wp_create_nonce( SettingsListener::NONCE );
|
||||||
?>
|
?>
|
||||||
<input type="hidden" name="ppcp-nonce" value="<?php echo esc_attr( $nonce ); ?>">
|
<input type="hidden" name="ppcp-nonce" value="<?php echo esc_attr( $nonce ); ?>">
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue