diff options
author | zotlabs <mike@macgirvin.com> | 2019-11-08 13:07:42 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-11-08 13:07:42 -0800 |
commit | 17522b31e9d7f092ecf5565ec28be270af7fad7b (patch) | |
tree | 109ef6f1e5f7b45caecc5422f9b68cad9dcaf6a0 /include/text.php | |
parent | a5826fec251447c1d9c94700183e9ed458127fba (diff) | |
download | volse-hubzilla-17522b31e9d7f092ecf5565ec28be270af7fad7b.tar.gz volse-hubzilla-17522b31e9d7f092ecf5565ec28be270af7fad7b.tar.bz2 volse-hubzilla-17522b31e9d7f092ecf5565ec28be270af7fad7b.zip |
exempt svg from tag completion
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/text.php b/include/text.php index 2496ca934..daa3c4c94 100644 --- a/include/text.php +++ b/include/text.php @@ -844,9 +844,9 @@ function get_tags($s) { $ret = array(); $match = array(); - // ignore anything in a code block - + // ignore anything in a code or svg block $s = preg_replace('/\[code(.*?)\](.*?)\[\/code\]/sm','',$s); + $s = preg_replace('/\[svg(.*?)\](.*?)\[\/svg\]/sm','',$s); // ignore anything in [style= ] $s = preg_replace('/\[style=(.*?)\]/sm','',$s); @@ -3414,18 +3414,20 @@ function cleanup_bbcode($body) { $body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','\red_escape_codeblock',$body); $body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','\red_escape_codeblock',$body); $body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','\red_escape_codeblock',$body); + $body = preg_replace_callback('/\[svg(.*?)\[\/(svg)\]/ism','\red_escape_codeblock',$body); - $body = preg_replace_callback("/([^\]\='".'"'."\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\ + $body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\ +\,\(\)]+)/ismu", '\nakedoembed', $body); - $body = preg_replace_callback("/([^\]\='".'"'."\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\ + $body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\ +\,\(\)]+)/ismu", '\red_zrl_callback', $body); $body = preg_replace_callback('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','\red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','\red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','\red_unescape_codeblock',$body); - + $body = preg_replace_callback('/\[\$b64svg(.*?)\[\/(svg)\]/ism','\red_unescape_codeblock',$body); + // fix any img tags that should be zmg $body = preg_replace_callback('/\[img(.*?)\](.*?)\[\/img\]/ism','\red_zrlify_img_callback',$body); |