diff --git a/include/bbcode.php b/include/bbcode.php
index 15e127625..bc0631e2f 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -275,7 +275,17 @@ function bb_parse_app($match) {
}
function bb_svg($match) {
- return '';
+ $Text = $match[1];
+
+ $Text = str_replace(['(',')'],['(',')'],$Text);
+ $Text = preg_replace("/\[line (.*?)]/", '', $Text);
+ $Text = preg_replace("/\[circle (.*?)]/", '', $Text);
+ $Text = preg_replace("/\[rect (.*?)]/", '', $Text);
+ $Text = preg_replace("/\[polygon (.*?)]/", '', $Text);
+ $Text = preg_replace("/\[ellipse (.*?)]/", '', $Text);
+ $Text = preg_replace("/\[text (.*?)](.*?)\[\/text\]/", '$2', $Text);
+
+ return '';
}
function bb_parse_element($match) {
@@ -1497,12 +1507,6 @@ function bbcode($Text, $options = []) {
// SVG stuff
$Text = preg_replace_callback("/\[svg\](.*?)\[\/svg\]/", 'bb_svg', $Text);
- $Text = preg_replace("/\[line (.*?)]/", '', $Text);
- $Text = preg_replace("/\[circle (.*?)]/", '', $Text);
- $Text = preg_replace("/\[rect (.*?)]/", '', $Text);
- $Text = preg_replace("/\[polygon (.*?)]/", '', $Text);
- $Text = preg_replace("/\[ellipse (.*?)]/", '', $Text);
- $Text = preg_replace("/\[text (.*?)](.*?)\[\/text\]/", '$2', $Text);
// oembed tag
if(! $export)