mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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 );
|
||||
}
|
||||
|
||||
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.Recommended
|
||||
}
|
||||
|
|
|
@ -98,10 +98,14 @@ class SettingsRenderer {
|
|||
* @return 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();
|
||||
}
|
||||
//phpcs:enable WordPress.Security.NonceVerification.Recommended
|
||||
//phpcs:enable WordPress.Security.NonceVerification.Missing
|
||||
|
||||
$messages = array(
|
||||
new Message(
|
||||
|
@ -250,9 +254,12 @@ class SettingsRenderer {
|
|||
*/
|
||||
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 ] ) );
|
||||
$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 ); ?>">
|
||||
<?php
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue