Skip to content

Commit 3488960

Browse files
OlegApanovichcagdasdag
authored andcommitted
VC-3545 improve shortcode regex
1 parent cf9cdd3 commit 3488960

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

visualcomposer/Modules/Elements/EncodedShortcode/Controller.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ public function checkEncodedShortcode($content)
4141
if (strpos($content, 'vcv_encoded_shortcode') === false) {
4242
return $content;
4343
}
44+
$regex = '/' . $this->get_shortcode_regex('vcv_encoded_shortcode') . '/';
4445

45-
$regex = $this->get_shortcode_regex('vcv_encoded_shortcode');
46-
return preg_replace('/' . $regex . '/', '', $content);
46+
while (preg_match($regex, $content)) {
47+
$content = preg_replace($regex, '', $content);
48+
}
49+
50+
return $content;
4751
}
4852

4953
/**

0 commit comments

Comments
 (0)