From 10262bfd5f8752e437c569b7d17ac31e6119f074 Mon Sep 17 00:00:00 2001 From: Iris Abarquez Date: Fri, 27 Sep 2024 08:39:10 +1000 Subject: [PATCH] WPCIVIUX-165 Remove regex filter for security --- .../abstract-class/class-abstract-civicrm-ux-shortcode.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/abstract-class/class-abstract-civicrm-ux-shortcode.php b/includes/abstract-class/class-abstract-civicrm-ux-shortcode.php index 18dfc22..3148045 100644 --- a/includes/abstract-class/class-abstract-civicrm-ux-shortcode.php +++ b/includes/abstract-class/class-abstract-civicrm-ux-shortcode.php @@ -37,12 +37,9 @@ abstract public function shortcode_callback( $atts = [], $content = null, $tag = */ public function clean_content_output($content = '') { // Default regex patterns to remove empty and misconfigured

tags and
tags - $default_regex = '/

(\s* \s*|\s*)<\/p>|<\/p>\s*

|/'; - - // Apply a filter so users can change the regex pattern - $custom_regex = apply_filters('ux_shortcode_clean_content_output_regex', $default_regex); + $regex = '/

(\s* \s*|\s*)<\/p>|<\/p>\s*

|/'; - $cleaned = preg_replace($custom_regex, '', $content); + $cleaned = preg_replace($regex, '', $content); return $cleaned; }