diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-18 19:15:01 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-18 19:15:01 -0700 |
commit | 6aa159e2ac09a03cdf52f17e0815a3ddc4cb9650 (patch) | |
tree | ee59150767d72547052aff088eeccec70c216193 /include | |
parent | 2963be60e53916c9c6d579745695a54800876f82 (diff) | |
parent | 25e134dd9cb4768291517678286a197d5a4e79a6 (diff) | |
download | volse-hubzilla-6aa159e2ac09a03cdf52f17e0815a3ddc4cb9650.tar.gz volse-hubzilla-6aa159e2ac09a03cdf52f17e0815a3ddc4cb9650.tar.bz2 volse-hubzilla-6aa159e2ac09a03cdf52f17e0815a3ddc4cb9650.zip |
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Diffstat (limited to 'include')
-rw-r--r-- | include/bb2diaspora.php | 8 | ||||
-rw-r--r-- | include/text.php | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index fc82cb48c..692128087 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -413,10 +413,18 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { // Convert it to HTML - don't try oembed $Text = bbcode($Text, $preserve_nl, false); + // Markdownify does not preserve previously escaped html entities such as <> and &. + + $Text = str_replace(array('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text); + // Now convert HTML to Markdown $md = new Markdownify(false, false, false); $Text = $md->parseString($Text); + // It also adds backslashes to our attempt at getting around the html entity preservation for some weird reason. + + $Text = str_replace(array('&\\_lt\\_;','&\\_gt\\_;','&\\_amp\\_;'),array('<','>','&'),$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(). diff --git a/include/text.php b/include/text.php index 90ad57f62..377c1c46f 100644 --- a/include/text.php +++ b/include/text.php @@ -1075,9 +1075,9 @@ function list_smilies() { ); $icons = array( - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" />', - '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="<\\3" />', + '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />', + '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" />', + '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-brokenheart.gif" alt="<\\3" />', '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-smile.gif" alt=":-)" />', '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-wink.gif" alt=";-)" />', '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-frown.gif" alt=":-(" />', @@ -1186,7 +1186,7 @@ function preg_heart($x) { $t = ''; for($cnt = 0; $cnt < strlen($x[1]); $cnt ++) - $t .= '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />'; + $t .= '<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-heart.gif" alt="<3" />'; $r = str_replace($x[0],$t,$x[0]); |