From 4b3450265abdfa4a885c1deb8f0880c882218a2a Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Wed, 2 Aug 2017 11:49:15 +0200 Subject: [PATCH] Hack for CKEditor and GeSHiFilter --- sites/all/libraries/geshi/geshi.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sites/all/libraries/geshi/geshi.php b/sites/all/libraries/geshi/geshi.php index c6ff9ef..cb944e4 100644 --- a/sites/all/libraries/geshi/geshi.php +++ b/sites/all/libraries/geshi/geshi.php @@ -2161,6 +2161,16 @@ class GeSHi { $code = str_replace("\r\n", "\n", $this->source); $code = str_replace("\r", "\n", $code); + // Hack for "CKEditor and GeSHiFilter": + $code = str_replace(">", ">", $code); + $code = str_replace("<", "<", $code); + $code = str_replace("›", "›", $code); + $code = str_replace("‹", "‹", $code); + $code = str_replace("'", "'", $code); + $code = str_replace(""", "\"", $code); + $code = str_replace("&", "&", $code); + // End Hack. + // Firstly, if there is an error, we won't highlight if ($this->error) { //Escape the source for output @@ -4772,4 +4782,4 @@ if (!function_exists('geshi_highlight')) { } } -?> \ No newline at end of file +?>