This commit is contained in:
Mario Vavti 2019-05-24 10:27:45 +02:00
parent 9ea483d1dc
commit 528b9b6a60

View File

@ -76,6 +76,8 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
$s = html2bbcode($s); $s = html2bbcode($s);
$s = bb_code_protect($s);
// Convert everything that looks like a link to a link // Convert everything that looks like a link to a link
if($use_zrl) { if($use_zrl) {
if (strpos($s,'[/img]') !== false) { 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 = 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 // remove duplicate adjacent code tags
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s); $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);