From cc56f33b80bdd871b8a1245e3c4bd3a31ed49330 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 18 Jun 2012 01:29:08 +0200 Subject: New option in the bbcode parser to disable oembed. --- include/bb2diaspora.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'include/bb2diaspora.php') diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 0617ecc5f..7b4caec46 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -70,6 +70,17 @@ function stripdcode_br_cb($s) { function bb2diaspora($Text,$preserve_nl = false) { + // Convert it to HTML - don't try oembed + $Text = bbcode($Text, $preserve_nl, false); + + // Now convert HTML to Markdown + $md = new Markdownify(false, false, false); + $Text = $md->parseString($Text); + + // Remove all unconverted tags + $Text = strip_tags($Text); + +/* $ev = bbtoevent($Text); // Replace any html brackets with HTML Entities to prevent executing HTML or script @@ -85,17 +96,7 @@ function bb2diaspora($Text,$preserve_nl = false) { if($preserve_nl) $Text = str_replace(array("\n","\r"), array('',''),$Text); - // Convert it to HTML - $Text = bbcode($Text); - // Now convert HTML to Markdown - $md = new Markdownify(false, false, false); - $Text = $md->parseString($Text); - - // Remove all unconverted tags - $Text = strip_tags($Text); - -/* // Set up the parameters for a URL search string $URLSearchString = "^\[\]"; // Set up the parameters for a MAIL search string -- cgit v1.2.3