← All changes
|
src/Campaigns/Shortcodes/CampaignCommentsShortcode.php
+2
-1
4.15.4
→
4.16.9
View file →
| @@ -56,8 +56,9 @@ | ||
| 56 | 56 | wp_enqueue_style('givewp-design-system-foundation'); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | + * @since 4.16.1 sanitize block_id from shortcode attributes | |
| 60 | 61 | * @since 4.5.0 |
| 61 | 62 | */ |
| 62 | 63 | private function parseAttributes($atts): array |
| 63 | 64 | { |
| @@ -74,9 +75,9 @@ | ||
| 74 | 75 | 'comments_per_page'=> 3, |
| 75 | 76 | ], $atts, 'givewp_campaign_comments'); |
| 76 | 77 | |
| 77 | 78 | return [ |
| 78 | - 'blockId' => (string) $atts['block_id'], | |
| 79 | + 'blockId' => sanitize_key((string) $atts['block_id']), | |
| 79 | 80 | 'campaignId' => (int) $atts['campaign_id'], |
| 80 | 81 | 'title' => (string) $atts['title'], |
| 81 | 82 | 'showAnonymous' => filter_var($atts['show_anonymous'], FILTER_VALIDATE_BOOLEAN), |
| 82 | 83 | 'showAvatar' => filter_var($atts['show_avatar'], FILTER_VALIDATE_BOOLEAN), |