diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 259d0fcb7..8f90159a4 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -492,6 +492,7 @@ class e_parse extends e_parser public function toDB($data, $nostrip =false, $no_encode = false, $mod = false, $original_author = false) { $core_pref = e107::getConfig(); + if (is_array($data)) { $ret = array(); @@ -577,6 +578,40 @@ class e_parse extends e_parser $ret = preg_replace("#\[(php)#i", "[\\1", $ret); } + // Don't allow hooks to mess with prefs. + if($mod === 'pReFs') + { + return $ret; + } + + + /** + * e_parse hook + */ + $eParseList = $core_pref->get('e_parse_list'); + if(!empty($eParseList)) + { + + $opts = array( + 'nostrip' => $nostrip, + 'noencode' => $no_encode, + 'mode' => $mod, + 'author' => $original_author + ); + + foreach($eParseList as $plugin) + { + $hookObj = e107::getAddon($plugin, 'e_parse'); + if($tmp = e107::callMethod($hookObj, 'toDB', $ret, $opts)) + { + $ret = $tmp; + } + + } + + } + + return $ret; } @@ -1395,7 +1430,7 @@ class e_parse extends e_parser $textReplace = (!empty($opts['sub'])) ? $opts['sub'] : ''; - if(substr($textReplace,-6) == '.glyph') + if(substr($textReplace,-6) === '.glyph') { $textReplace = $this->toGlyph($textReplace,''); } @@ -1700,14 +1735,15 @@ class e_parse extends e_parser $subcon = preg_split('#((?:]+>.*?|tyle[^>]+>.*?))#mis', $full_text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); foreach ($subcon as $sub_blk) { - if(substr($sub_blk, 0, 7) == 'replaceConstants($url,'abs'); // always switch to 'nice' urls when SC is used diff --git a/e107_plugins/_blank/e_parse.php b/e107_plugins/_blank/e_parse.php index b4dc9487c..2ca30fa61 100644 --- a/e107_plugins/_blank/e_parse.php +++ b/e107_plugins/_blank/e_parse.php @@ -32,6 +32,7 @@ class _blank_parse /** + * Process a string before it is sent to the browser as html. * @param string $text html/text to be processed. * @param string $context Current context ie. OLDDEFAULT | BODY | TITLE | SUMMARY | DESCRIPTION | WYSIWYG etc. * @return string @@ -44,6 +45,22 @@ class _blank_parse + + /** + * Process a string before it is saved to the database. + * @param string $text html/text to be processed. + * @param array $param nostrip, noencode etc. + * @return string + */ + function toDB($text, $param=array()) + { + $text = str_replace('
', '****', $text); + return $text; + } + + + + }