Merge remote-tracking branch 'mike/master' into dev

This commit is contained in:
Mario Vavti 2018-01-15 08:56:15 +01:00
commit b49e09939a
3 changed files with 19 additions and 27 deletions

View File

@ -504,7 +504,12 @@ class Item extends \Zotlabs\Web\Controller {
$body = z_input_filter($body,$mimetype,$execflag);
}
// Verify ability to use html or php!!!
$arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ];
call_hooks('post_content',$arr);
$body = $arr['content'];
$mimetype = $arr['mimetype'];
$gacl = $acl->get();
$str_contact_allow = $gacl['allow_cid'];
@ -516,13 +521,6 @@ class Item extends \Zotlabs\Web\Controller {
require_once('include/text.php');
if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
require_once('include/markdown.php');
$body = preg_replace_callback('/\[share(.*?)\]/ism','\share_shield',$body);
$body = markdown_to_bb($body,true,['preserve_lf' => 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.)

View File

@ -373,15 +373,6 @@ function get_features($filtered = true) {
t('Post/Comment Tools'),
[
'markdown',
t('Markdown'),
t('Use markdown for editing posts'),
false,
get_config('feature_lock','markdown'),
feature_level('markdown',2),
],
[
'commtag',
t('Community Tagging'),
@ -490,6 +481,8 @@ function get_features($filtered = true) {
else {
$narr = $arr;
}
call_hooks('get_features',$narr);
return $narr;
$x = [ 'features' => $narr, 'filtered' => $filtered, 'techlevel' => $techlevel ];
call_hooks('get_features',$x);
return $x['features'];
}

View File

@ -188,13 +188,14 @@ function html2bbcode($message)
node2bbcode($doc, 'hr', array(), "[hr]", "");
node2bbcode($doc, 'table', array(), "", "");
node2bbcode($doc, 'tr', array(), "\n", "");
node2bbcode($doc, 'td', array(), "\t", "");
//node2bbcode($doc, 'table', array(), "[table]", "[/table]");
//node2bbcode($doc, 'th', array(), "[th]", "[/th]");
//node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
//node2bbcode($doc, 'td', array(), "[td]", "[/td]");
// node2bbcode($doc, 'table', array(), "", "");
// node2bbcode($doc, 'tr', array(), "\n", "");
// node2bbcode($doc, 'td', array(), "\t", "");
node2bbcode($doc, 'table', array(), "[table]", "[/table]");
node2bbcode($doc, 'th', array(), "[th]", "[/th]");
node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
node2bbcode($doc, 'td', array(), "[td]", "[/td]");
node2bbcode($doc, 'h1', array(), "\n\n[h1]", "[/h1]\n");
node2bbcode($doc, 'h2', array(), "\n\n[h2]", "[/h2]\n");
@ -211,7 +212,7 @@ function html2bbcode($message)
node2bbcode($doc, 'video', array('src'=>'/(.+)/'), '[video]$1', '[/video]');
node2bbcode($doc, 'audio', array('src'=>'/(.+)/'), '[audio]$1', '[/audio]');
node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]');
// node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]');
node2bbcode($doc, 'code', array(), '[code]', '[/code]');