Skip to content

Commit

Permalink
Fix: sanitize give_form shortcode args (#7375)
Browse files Browse the repository at this point in the history
Co-authored-by: Ante Laca <[email protected]>
  • Loading branch information
alaca authored Apr 30, 2024
1 parent beec47e commit b7aae2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions includes/class-give-donate-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,10 @@ public function get_type() {
* @return string
*/
public function get_form_classes( $args ) {
/**
* @unreleased sanitize $args
*/
$args = give_clean($args);

$float_labels_option = give_is_float_labels_enabled( $args )
? 'float-labels-enabled'
Expand Down Expand Up @@ -850,6 +854,11 @@ public function get_form_classes( $args ) {
* @return string
*/
public function get_form_wrap_classes( $args ) {
/**
* @unreleased sanitize $args
*/
$args = give_clean($args);

$custom_class = [
'give-form-wrap',
];
Expand Down
5 changes: 5 additions & 0 deletions includes/forms/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ function give_get_donation_form( $args = [] ) {
global $post;
static $count = 1;

/**
* @unreleased sanitize $args
*/
$args = give_clean($args);

$args = wp_parse_args( $args, give_get_default_form_shortcode_args() );

// Backward compatibility for `form_id` function param.
Expand Down

0 comments on commit b7aae2e

Please sign in to comment.