Merge pull request #355 from fermionic/missing-urls-after-strip_tags-in-bb2diaspora

allow bare URLS to make it through to Diaspora
This commit is contained in:
fermionic 2012-06-23 21:08:19 -07:00
commit 38b8317726

View file

@ -131,6 +131,12 @@ function bb2diaspora($Text,$preserve_nl = false) {
$md = new Markdownify(false, false, false); $md = new Markdownify(false, false, false);
$Text = $md->parseString($Text); $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: <http://url.com>, which gets removed by strip_tags().
// So take off the angle brackets of any such URL
$Text = preg_replace("/<http(.*?)>/is", "http$1", $Text);
// Remove all unconverted tags // Remove all unconverted tags
$Text = strip_tags($Text); $Text = strip_tags($Text);