aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-05-24 08:27:45 +0000
committerMario <mario@mariovavti.com>2019-05-24 12:27:14 +0200
commit385be35ed56a4dfffb0cd2fabdb094bd26535b86 (patch)
treec3236d935e18b945417b2137e2b1a71a475cbe63
parentdd374eaebfd6452f3a4a184efdb3a531aec88130 (diff)
downloadvolse-hubzilla-385be35ed56a4dfffb0cd2fabdb094bd26535b86.tar.gz
volse-hubzilla-385be35ed56a4dfffb0cd2fabdb094bd26535b86.tar.bz2
volse-hubzilla-385be35ed56a4dfffb0cd2fabdb094bd26535b86.zip
fix #1374
(cherry picked from commit 528b9b6a60d847b0ecb639cb7fb8e01ee79b11d4)
-rw-r--r--include/markdown.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/markdown.php b/include/markdown.php
index 2513a7d77..7d1f16958 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -76,6 +76,8 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
$s = html2bbcode($s);
+ $s = bb_code_protect($s);
+
// Convert everything that looks like a link to a link
if($use_zrl) {
if (strpos($s,'[/img]') !== false) {
@@ -88,6 +90,8 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
$s = preg_replace("/([^\]\=\{\/]|^)(https?\:\/\/)([a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]+)/ismu", '$1[url=$2$3]$2$3[/url]',$s);
}
+ $s = bb_code_unprotect($s);
+
// remove duplicate adjacent code tags
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);