X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbb2diaspora.php;h=d86ba454375b72cdb481c6a5da845028e90e3502;hb=0f5a6bfcdbde8f53283826251056a4670bdf9f7a;hp=8487f845a62848a75750632f14b773047096dbde;hpb=4bee1859be5fbf46ecc19728a908e31b4e9b09b6;p=friendica.git diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 8487f845a6..d86ba45437 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -221,13 +221,18 @@ function bb2diaspora($Text,$preserve_nl = false) { $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text); - $Text = preg_replace('/\[(.*?)\]\((.*?)\\\\_(.*?)\)/ism','[$1]($2_$3)',$Text); + $Text = preg_replace_callback('/\[(.*?)\]\((.*?)\)/ism','unescape_underscores_in_links',$Text); call_hooks('bb2diaspora',$Text); return $Text; } +function unescape_underscores_in_links($m) { + $y = str_replace('\\_','_', $m[2]); + return('[' . $m[1] . '](' . $y . ')'); +} + function format_event_diaspora($ev) { $a = get_app();