| @@ -25,12 +25,16 @@ | ||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Returns Shortcode markup |
| 28 | 28 | * |
| 29 | + * @since 3.7.0 Sanitize attributes | |
| 30 | + * @since 3.0.3 Use static function on array_map callback to pass the id as reference for _give_redirect_form_id to prevent warnings on PHP 8.0.1 or plus | |
| 29 | 31 | * @since 2.9.0 |
| 30 | 32 | **/ |
| 31 | 33 | public function renderCallback($attributes) |
| 32 | 34 | { |
| 35 | + $attributes = give_clean($attributes); | |
| 36 | + | |
| 33 | 37 | $attributes = $this->parseAttributes( |
| 34 | 38 | [ |
| 35 | 39 | 'ids' => [], |
| 36 | 40 | 'tags' => [], |
| @@ -45,11 +49,19 @@ | ||
| 45 | 49 | ], |
| 46 | 50 | $attributes, |
| 47 | 51 | 'give_multi_form_goal' |
| 48 | 52 | ); |
| 53 | + | |
| 49 | 54 | $multiFormGoal = new MultiFormGoal( |
| 50 | 55 | [ |
| 51 | - 'ids' => $attributes['ids'], | |
| 56 | + 'ids' => array_map( | |
| 57 | + static function ($id) { | |
| 58 | + _give_redirect_form_id($id); | |
| 59 | + | |
| 60 | + return $id; | |
| 61 | + }, | |
| 62 | + $attributes['ids'] | |
| 63 | + ), | |
| 52 | 64 | 'tags' => $attributes['tags'], |
| 53 | 65 | 'categories' => $attributes['categories'], |
| 54 | 66 | 'goal' => $attributes['goal'], |
| 55 | 67 | 'enddate' => $attributes['enddate'], |