Skip to content

Commit

Permalink
Custom input callback is not required, the default `sanitize_textarea…
Browse files Browse the repository at this point in the history
…_field` seems ok.
  • Loading branch information
remcotolsma committed Oct 11, 2023
1 parent 8490643 commit 632734f
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,6 @@ public function get_settings_fields() {
'callback' => [ $this, 'field_private_key' ],
'classes' => [ 'code' ],
'tooltip' => __( 'The secret key is used for secure communication with the payment provider. If left empty, the secret key will be generated using the given secret key password.', 'pronamic-ideal' ),
'input' => function ( $name ) {
// phpcs:disable WordPress.Security.NonceVerification.Missing

if ( ! \array_key_exists( $name, $_POST ) ) {
return '';
}

// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Private key can contain whitespace, HTML tags and percent-encoded characters.
return $_POST[ $name ];

// phpcs:enable WordPress.Security.NonceVerification.Missing
},
];

// Certificate.
Expand All @@ -236,18 +224,6 @@ public function get_settings_fields() {
'callback' => [ $this, 'field_certificate' ],
'classes' => [ 'code' ],
'tooltip' => __( 'The certificate is used for secure communication with the payment provider. If left empty, the certificate will be generated using the secret key and given organization details.', 'pronamic-ideal' ),
'input' => function ( $name ) {
// phpcs:disable WordPress.Security.NonceVerification.Missing

if ( ! \array_key_exists( $name, $_POST ) ) {
return '';
}

// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Certificate can contain whitespace, HTML tags and percent-encoded characters.
return $_POST[ $name ];

// phpcs:enable WordPress.Security.NonceVerification.Missing
},
];

// Return.
Expand Down

0 comments on commit 632734f

Please sign in to comment.