From 56fea2103e4e0e0b0271ae120898b169bdd70256 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 4 Apr 2013 12:35:43 +0000 Subject: [PATCH] * API/eMail/HTMLawed/CKEditor: tidy eats away even some wanted whitespace, so we switch it off;we used it for its compacting and beautifying capabilities, which resulted in better html for further processing --- felamimail/inc/class.felamimail_bo.inc.php | 4 +++- felamimail/inc/class.uidisplay.inc.php | 3 ++- phpgwapi/inc/class.egw_htmLawed.inc.php | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/felamimail/inc/class.felamimail_bo.inc.php b/felamimail/inc/class.felamimail_bo.inc.php index 864336b6c3..a76a2cd958 100644 --- a/felamimail/inc/class.felamimail_bo.inc.php +++ b/felamimail/inc/class.felamimail_bo.inc.php @@ -49,7 +49,9 @@ class felamimail_bo 'balance'=>1,//turn off tag-balancing (config['balance']=>0). That will not introduce any security risk; only standards-compliant tag nesting check/filtering will be turned off (basic tag-balance will remain; i.e., there won't be any unclosed tag, etc., after filtering) 'direct_list_nest' => 1, 'allow_for_inline' => array('table','div','li','p'),//block elements allowed for nesting when only inline is allowed; Example span does not allow block elements as table; table is the only element tested so far - 'tidy'=>1, + // tidy eats away even some wanted whitespace, so we switch it off; + // we used it for its compacting and beautifying capabilities, which resulted in better html for further processing + 'tidy'=>0, 'elements' => "* -script", 'deny_attribute' => 'on*', 'schemes'=>'href: file, ftp, http, https, mailto; src: cid, data, file, ftp, http, https; *:file, http, https, cid, src', diff --git a/felamimail/inc/class.uidisplay.inc.php b/felamimail/inc/class.uidisplay.inc.php index 42c745f0de..d888a018f7 100644 --- a/felamimail/inc/class.uidisplay.inc.php +++ b/felamimail/inc/class.uidisplay.inc.php @@ -1575,9 +1575,10 @@ blockquote[type=cite] { if (($test=="null" || $test === false || is_null($test)) && strlen($newBody)>0) { $newBody = $newBodyBuff; + $tv = felamimail_bo::$htmLawed_config['tidy']; felamimail_bo::$htmLawed_config['tidy'] = 0; felamimail_bo::getCleanHTML($newBody,$usepurifier); - felamimail_bo::$htmLawed_config['tidy'] = 1; + felamimail_bo::$htmLawed_config['tidy'] = $tv; } } diff --git a/phpgwapi/inc/class.egw_htmLawed.inc.php b/phpgwapi/inc/class.egw_htmLawed.inc.php index 5eccf7af81..11295ebeb0 100644 --- a/phpgwapi/inc/class.egw_htmLawed.inc.php +++ b/phpgwapi/inc/class.egw_htmLawed.inc.php @@ -83,7 +83,9 @@ class egw_htmLawed $this->Configuration = array('comment'=>1, //remove comments 'make_tag_strict'=>3,//3 is a new own config value, to indicate that transformation is to be performed, but don't transform font, as size transformation of numeric sizes to keywords alters the intended result too much 'balance'=>0,//turn off tag-balancing (config['balance']=>0). That will not introduce any security risk; only standards-compliant tag nesting check/filtering will be turned off (basic tag-balance will remain; i.e., there won't be any unclosed tag, etc., after filtering) - 'tidy'=>1, + // tidy eats away even some wanted whitespace, so we switch it off; + // we used it for its compacting and beautifying capabilities, which resulted in better html for further processing + 'tidy'=>0, 'elements' => "* -script", 'deny_attribute' => 'on*', 'schemes'=>'href: file, ftp, http, https, mailto; src: cid, data, file, ftp, http, https; *:file, http, https',