diff options
author | Mario Vavti <mario@mariovavti.com> | 2024-10-12 19:06:35 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2024-10-12 19:06:35 +0200 |
commit | d7fa6f670906323a161eee15e61744163dc3ea01 (patch) | |
tree | ce0f52e5b254289e1532f1ff62b92bd1560b3cd6 /include | |
parent | 47cdef390a096db650033fd9f1b00a6b731c982e (diff) | |
parent | 40a9989be2366f30a37c8d451bae74a1d304319b (diff) | |
download | volse-hubzilla-d7fa6f670906323a161eee15e61744163dc3ea01.tar.gz volse-hubzilla-d7fa6f670906323a161eee15e61744163dc3ea01.tar.bz2 volse-hubzilla-d7fa6f670906323a161eee15e61744163dc3ea01.zip |
Merge branch 'dev' into containers
Diffstat (limited to 'include')
-rw-r--r-- | include/text.php | 7 | ||||
-rw-r--r-- | include/zid.php | 28 |
2 files changed, 16 insertions, 19 deletions
diff --git a/include/text.php b/include/text.php index 137622b7d..e69ce7d10 100644 --- a/include/text.php +++ b/include/text.php @@ -3755,12 +3755,9 @@ function cleanup_bbcode($body) { $body = preg_replace_callback('/\[img(.*?)\[\/(img)\]/ism','\red_escape_codeblock',$body); $body = preg_replace_callback('/\[zmg(.*?)\[\/(zmg)\]/ism','\red_escape_codeblock',$body); - $body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\ -+\,\(\)]+)/ismu", '\nakedoembed', $body); - - $body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\ -+\,\(\)]+)/ismu", '\red_zrl_callback', $body); + $body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\+\,\(\)]+)/ismu", '\nakedoembed', $body); + $body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\+\,\(\)]+)/ismu", '\red_zrl_callback', $body); $body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','\red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64summary(.*?)\[\/(summary)\]/ism','\red_unescape_codeblock',$body); diff --git a/include/zid.php b/include/zid.php index 159a3b834..2b5d53916 100644 --- a/include/zid.php +++ b/include/zid.php @@ -261,25 +261,25 @@ function zidify_text($s) { */ function red_zrl_callback($matches) { - // Catch and exclude trailing punctuation - preg_match("/[.,;:!?)]*$/i", $matches[2], $pts); - $matches[2] = substr($matches[2], 0, strlen($matches[2])-strlen($pts[0])); + // Catch and exclude trailing punctuation + preg_match("/[.,;:!?)]*$/i", $matches[2], $pts); + $matches[2] = substr($matches[2], 0, strlen($matches[2])-strlen($pts[0])); - $zrl = is_matrix_url($matches[2]); + $zrl = is_matrix_url($matches[2]); - $t = strip_zids($matches[2]); - if($t !== $matches[2]) { - $zrl = true; - $matches[2] = $t; - } + $t = strip_zids($matches[2]); + if($t !== $matches[2]) { + $zrl = true; + $matches[2] = $t; + } - if($matches[1] === '#^') - $matches[1] = ''; + if($matches[1] === '#^') + $matches[1] = ''; - if($zrl) - return $matches[1] . '#^[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]' . $pts[0]; + if($zrl) + return $matches[1] . '#^[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]' . $pts[0]; - return $matches[1] . '#^[url=' . $matches[2] . ']' . $matches[2] . '[/url]' . $pts[0]; + return $matches[1] . '#^[url=' . $matches[2] . ']' . $matches[2] . '[/url]' . $pts[0]; } /** |