diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-03-04 06:05:47 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-03-04 06:05:47 +0100 |
commit | 059da4d01705ca1515e0ccf4b790c407c751685c (patch) | |
tree | a7f77e3734ba1e53bf7980ff1b6f0c73bc814602 /mod/item.php | |
parent | 264abef81761a3ed0d27126dbc5a6e0a47fb8ec8 (diff) | |
parent | a59d1b22f6ab1bf5b3cf5df555d71b893c05540a (diff) | |
download | volse-hubzilla-059da4d01705ca1515e0ccf4b790c407c751685c.tar.gz volse-hubzilla-059da4d01705ca1515e0ccf4b790c407c751685c.tar.bz2 volse-hubzilla-059da4d01705ca1515e0ccf4b790c407c751685c.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/item.php')
-rw-r--r-- | mod/item.php | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/mod/item.php b/mod/item.php index f23bff3ac..038a967b2 100644 --- a/mod/item.php +++ b/mod/item.php @@ -477,15 +477,28 @@ function item_post(&$a) { if($mimetype === 'text/bbcode') { require_once('include/text.php'); - if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) { - require_once('include/bb2diaspora.php'); - $body = escape_tags(trim($body)); - $body = str_replace("\n",'<br />', $body); - - $body = preg_replace_callback('/\[share(.*?)\]/ism','share_shield',$body); - $body = diaspora2bb($body,true); - $body = preg_replace_callback('/\[share(.*?)\]/ism','share_unshield',$body); - } + + // Markdown doesn't work correctly. Do not re-enable unless you're willing to fix it and support it. + + // Sample that will probably give you grief - you must preserve the linebreaks + // and provide the correct markdown interpretation and you cannot allow unfiltered HTML + + // Markdown + // ======== + // + // **bold** abcde + // fghijkl + // *italic* + // <img src="javascript:alert('hacked');" /> + +// if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) { +// require_once('include/bb2diaspora.php'); +// $body = escape_tags(trim($body)); +// $body = str_replace("\n",'<br />', $body); +// $body = preg_replace_callback('/\[share(.*?)\]/ism','share_shield',$body); +// $body = diaspora2bb($body,true); +// $body = preg_replace_callback('/\[share(.*?)\]/ism','share_unshield',$body); +// } // BBCODE alert: the following functions assume bbcode input // and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.) |