Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: sanitize give_form shortcode args #7375

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading