From 1bbf423c1ecbb1ee3506291e047937a04fd09e6f Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 24 Nov 2015 15:35:43 +0000 Subject: [PATCH] Do not use tidy extension by default - Fix reply to some emails do no open compose dialog --- mail/inc/class.mail_compose.inc.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 74a048bfc6..438dd9763b 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -2144,14 +2144,22 @@ class mail_compose return $this->sessionData; } - - static function _getCleanHTML($_body) + + /** + * HTML cleanup + * + * @param type $_body message + * @param type $_useTidy = false, if true tidy extention will be loaded and tidy will try to clean body message + * since the tidy causes segmentation fault ATM, we set the default to false. + * @return type + */ + static function _getCleanHTML($_body, $_useTidy = false) { static $nonDisplayAbleCharacters = array('[\016]','[\017]', '[\020]','[\021]','[\022]','[\023]','[\024]','[\025]','[\026]','[\027]', '[\030]','[\031]','[\032]','[\033]','[\034]','[\035]','[\036]','[\037]'); - if (extension_loaded('tidy')) + if ($_useTidy && extension_loaded('tidy') ) { $tidy = new tidy(); $cleaned = $tidy->repairString($_body, mail_bo::$tidy_config,'utf8');