From 5d2eed35177da3debacc6db6db2f7a74bc4b64c7 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sat, 23 Jun 2012 22:02:08 -0600 Subject: [PATCH] allow bare URLS to make it through to Diaspora --- include/bb2diaspora.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 75ba57dff..ac693127b 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -131,6 +131,12 @@ function bb2diaspora($Text,$preserve_nl = false) { $md = new Markdownify(false, false, false); $Text = $md->parseString($Text); + // If the text going into bbcode() has a plain URL in it, i.e. + // with no [url] tags around it, it will come out of parseString() + // looking like: , which gets removed by strip_tags(). + // So take off the angle brackets of any such URL + $Text = preg_replace("//is", "http$1", $Text); + // Remove all unconverted tags $Text = strip_tags($Text);