diff options
-rw-r--r-- | Zotlabs/Lib/MarkdownSoap.php | 17 | ||||
-rwxr-xr-x | include/items.php | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/Zotlabs/Lib/MarkdownSoap.php b/Zotlabs/Lib/MarkdownSoap.php index a0214bbe4..534ad819f 100644 --- a/Zotlabs/Lib/MarkdownSoap.php +++ b/Zotlabs/Lib/MarkdownSoap.php @@ -77,15 +77,22 @@ class MarkdownSoap { } function purify($s) { -// $s = str_replace("\n",'<br>',$s); -// $s = str_replace("\t",' ',$s); -// $s = str_replace(' ',' ',$s); + $s = $this->protect_autolinks($s); $s = purify_html($s); -// $s = str_replace([' ', mb_convert_encoding(' ','UTF-8','HTML-ENTITIES')], [ ' ', ' ' ],$s); -// $s = str_replace(['<br>','<br />', '<', '>' ],["\n","\n", '<', '>'],$s); + $s = $this->unprotect_autolinks($s); return $s; } + function protect_autolinks($s) { + $s = preg_replace('/\<(https?\:\/\/)(.*?)\>/','[$1$2]($1$2)',$s); + return $s; + } + + function unprotect_autolinks($s) { + return $s; + + } + function escape($s) { return htmlspecialchars($s,ENT_QUOTES); } diff --git a/include/items.php b/include/items.php index 4b90840e2..328079b9d 100755 --- a/include/items.php +++ b/include/items.php @@ -1325,7 +1325,7 @@ function encode_item_flags($item) { $ret[] = 'consensus'; if(intval($item['item_obscured'])) $ret[] = 'obscured'; - if(intval($item['item_privat'])) + if(intval($item['item_private'])) $ret[] = 'private'; return $ret; |