diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 5b56116dc..1f03901a0 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -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. diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index d076f36b9..e6165bb36 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -37,8 +37,8 @@ class e107plugin 'e_meta', // @Deprecated 'e_emailprint', 'e_frontpage', - 'e_latest', // @Deprecated - see e_dashboard - 'e_status', //@Deprecated - see e_dashboard + 'e_latest', /* @deprecated - see e_dashboard */ + 'e_status', /* @deprecated - see e_dashboard */ 'e_menu', 'e_search', 'e_shortcode', @@ -55,8 +55,9 @@ class e107plugin 'e_url', // simple mod-rewrite. 'e_mailout', 'e_sitelink', // sitelinks generator. - 'e_tohtml', + 'e_tohtml', /* @deprecated - use e_parse */ 'e_featurebox', + 'e_parse', 'e_related', 'e_rss', 'e_upload', diff --git a/e107_plugins/_blank/e_parse.php b/e107_plugins/_blank/e_parse.php new file mode 100644 index 000000000..b4dc9487c --- /dev/null +++ b/e107_plugins/_blank/e_parse.php @@ -0,0 +1,52 @@ +', $text); + return $text; + } + + + +} + + + + +?> \ No newline at end of file diff --git a/e107_plugins/tinymce4/plugins/e107/parser.php b/e107_plugins/tinymce4/plugins/e107/parser.php index 9fc381fff..80806e4bd 100644 --- a/e107_plugins/tinymce4/plugins/e107/parser.php +++ b/e107_plugins/tinymce4/plugins/e107/parser.php @@ -129,7 +129,7 @@ TEMPL; //$content = str_replace('\r\n',"
",$content); //$content = nl2br($content, true); - $content = $tp->toHtml($content, true); + $content = $tp->toHtml($content, true, 'WYSIWYG'); } $content = str_replace("{e_BASE}",e_HTTP,$content); // We want {e_BASE} in the final data going to the DB, but not the editor. @@ -161,7 +161,7 @@ TEMPL; //echo $tp->toHtml(str_replace("\n","",$content), true); $content = str_replace("{e_BASE}",e_HTTP, $content); // We want {e_BASE} in the final data going to the DB, but not the editor. - $content = $tp->toHtml($content, true); + $content = $tp->toHtml($content, true, 'WYSIWYG'); $content = str_replace(e_MEDIA_IMAGE,"{e_MEDIA_IMAGE}",$content); $text = "";