From 1a9c059062eae14a96aac40b2fb4e1efb513dccc Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 18 Jun 2015 16:35:40 -0700 Subject: issues with markdownify and escaped HTML --- include/bb2diaspora.php | 8 ++++++++ include/text.php | 8 ++++---- version.inc | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 8129ab5e6..65f8f3ea1 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: , which gets removed by strip_tags(). diff --git a/include/text.php b/include/text.php index 9c6fe3622..7101d76da 100644 --- a/include/text.php +++ b/include/text.php @@ -1076,9 +1076,9 @@ function list_smilies() { ); $icons = array( - '<3', - '</3', - '<\\3', + '<3', + '</3', + '<\\3', ':-)', ';-)', ':-(', @@ -1187,7 +1187,7 @@ function preg_heart($x) { $t = ''; for($cnt = 0; $cnt < strlen($x[1]); $cnt ++) - $t .= '<3'; + $t .= '<3'; $r = str_replace($x[0],$t,$x[0]); diff --git a/version.inc b/version.inc index 4e53758a0..2b47a6bda 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-06-14.1063 +2015-06-18.1067 -- cgit v1.2.3 From 25e134dd9cb4768291517678286a197d5a4e79a6 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 18 Jun 2015 17:53:26 -0700 Subject: set return url from apps page --- mod/appman.php | 2 +- mod/apps.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/appman.php b/mod/appman.php index db22df883..e31492f0b 100644 --- a/mod/appman.php +++ b/mod/appman.php @@ -54,7 +54,7 @@ function appman_post(&$a) { if($_SESSION['return_url']) goaway(z_root() . '/' . $_SESSION['return_url']); - goaway(z_root() . '/apps/personal'); + goaway(z_root() . '/apps'); } diff --git a/mod/apps.php b/mod/apps.php index be9b54307..fcf545421 100644 --- a/mod/apps.php +++ b/mod/apps.php @@ -9,6 +9,8 @@ function apps_content(&$a) { else $mode = 'list'; + $_SESSION['return_url'] = $a->cmd; + $apps = array(); $syslist = get_system_apps(); -- cgit v1.2.3