From 85dc35db268088cd254733fef0f7cc873a22a2f8 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 14 May 2015 09:20:11 -0700 Subject: [PATCH] Fixes #1007 - toDB() was breaking {e_XXX} paths when HTML was used. --- e107_handlers/e_parse_class.php | 3 +++ e107_plugins/tinymce4/plugins/e107/parser.php | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 9674a10ba..357b07933 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -524,6 +524,9 @@ class e_parse extends e_parser $this->isHtml = true; $data = $this->cleanHtml($data); // sanitize all html. + $data = str_replace(array('%7B','%7D'),array('{','}'),$data); // fix for {e_XXX} paths. + + // $data = urldecode($data); //XXX Commented out : NO LONGER REQUIRED. symptom of cleaning the HTML - urlencodes src attributes containing { and } .eg. {e_BASE} } diff --git a/e107_plugins/tinymce4/plugins/e107/parser.php b/e107_plugins/tinymce4/plugins/e107/parser.php index cd8db7c52..44413a973 100644 --- a/e107_plugins/tinymce4/plugins/e107/parser.php +++ b/e107_plugins/tinymce4/plugins/e107/parser.php @@ -38,6 +38,17 @@ class e107TinyMceParser { $html = ''; + if(!empty($_GET['debug']) && getperms('0')) + { + $debug = true; // For future use. + // $_POST['content'] = ''; + // $_POST['mode'] = $_GET['mode']; + } + else + { + $debug = false; + } + if($_POST['mode'] == 'tohtml') { $html = $this->toHtml($_POST['content']); @@ -48,7 +59,11 @@ class e107TinyMceParser $html = $this->toBBcode($_POST['content']); } - if($this->gzipCompression == true) + if($debug == true) + { + print_a($html); + } + elseif($this->gzipCompression == true) { header('Content-Encoding: gzip'); $gzipoutput = gzencode($html,6);