aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-06-18 01:29:08 +0200
committerMichael Vogel <icarus@dabo.de>2012-06-18 01:29:08 +0200
commitcc56f33b80bdd871b8a1245e3c4bd3a31ed49330 (patch)
treed99a24233f530dcbc173c2fa91ed0d14aa2752f1 /include/bb2diaspora.php
parent3968e77f9e15c149d8cafa1dac37411777bd58bd (diff)
downloadvolse-hubzilla-cc56f33b80bdd871b8a1245e3c4bd3a31ed49330.tar.gz
volse-hubzilla-cc56f33b80bdd871b8a1245e3c4bd3a31ed49330.tar.bz2
volse-hubzilla-cc56f33b80bdd871b8a1245e3c4bd3a31ed49330.zip
New option in the bbcode parser to disable oembed.
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php21
1 files changed, 11 insertions, 10 deletions
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