1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-15 11:04:18 +02:00

Plugin Addons: e_tohtml.php deprecated in favor of new e_parse.php addon file. TinyMce now disables plugin hooks during parsing.

This commit is contained in:
Cameron
2016-08-01 12:58:03 -07:00
parent a33c752c86
commit 7de9daf9ff
4 changed files with 83 additions and 8 deletions

View File

@@ -154,9 +154,10 @@ class e_parse extends e_parser
array(
'defs'=>TRUE, 'constants'=>'full', 'parse_sc'=>TRUE
),
// text is parsed by the Wysiwyg editor. eg. TinyMce
'WYSIWYG' =>
array(
'defs'=>FALSE, 'constants'=>'full', 'parse_sc'=>FALSE, 'wysiwyg'=>TRUE
'hook' => false, 'link_click' => false, 'link_replace' => false, 'retain_nl' => true
),
// text is user-entered (i.e. untrusted)'body' or 'bulk' text (e.g. custom page body, content body)
'USER_BODY' =>
@@ -1900,9 +1901,30 @@ class e_parse extends e_parser
$this->e_hook[$hook] = new $hook_class;
}
}
$sub_blk = $this->e_hook[$hook]->to_html($sub_blk, $opts['context']);
if(is_object( $this->e_hook[$hook]))
{
$sub_blk = $this->e_hook[$hook]->to_html($sub_blk, $opts['context']);
}
}
}
if(!empty($pref['e_parse_list']))
{
foreach($pref['e_parse_list'] as $plugin)
{
$hookObj = e107::getAddon($plugin,'e_parse');
if($tmp = e107::callMethod($hookObj, 'toHTML', $sub_blk, $opts['context']))
{
$sub_blk = $tmp;
}
}
}
}
@@ -3186,7 +3208,7 @@ class e_parser
protected $allowedTags = array('html', 'body','div','a','img','table','tr', 'td', 'th', 'tbody', 'thead', 'colgroup', 'b',
'i', 'pre','code', 'strong', 'u', 'em','ul', 'ol', 'li','img','h1','h2','h3','h4','h5','h6','p',
'div','pre','section','article', 'blockquote','hgroup','aside','figure','figcaption', 'abbr','span', 'audio', 'video', 'br',
'small', 'caption', 'noscript', 'hr', 'section', 'iframe'
'small', 'caption', 'noscript', 'hr', 'section', 'iframe', 'sub', 'sup', 'cite'
);
protected $scriptTags = array('script','applet','form','input','button', 'embed', 'object'); //allowed when $pref['post_script'] is enabled.