From 360c35e438f4ecb6a60cefde8ab8b0e3f6f0c57f Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 4 Jul 2012 23:24:59 -0700 Subject: [PATCH] recycle symbol woes with multiple html entity encode/decode cycles going on --- include/bb2diaspora.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index d756b922d6..c93b60d0d1 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -44,6 +44,9 @@ function diaspora2bb($s) { $s = html2bbcode($s); // $s = str_replace('*','*',$s); + // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands + $s = str_replace('♲',html_entities_decode('♲',ENT_QUOTES,'UTF-8'),$s); + // Convert everything that looks like a link to a link $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3]$2$3[/url]',$s); -- 2.39.5