From cf5269f6d148c51e0ba820f3a9ecb1a91a5adcc1 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 10 Dec 2012 23:10:58 +0000 Subject: [PATCH] Check for empty user font preference span, and remove it so empty checks still work --- phpgwapi/inc/class.html.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index f3dfe48ca5..693ce6a60c 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -1336,7 +1336,19 @@ class html static function purify($html,$config=null,$spec=array(),$_force=false) { $defaultConfig = array('valid_xhtml'=>1,'safe'=>1); + if (empty($html)) return $html; // no need to process further + + // User preferences + $font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font']; + $font_size = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font_size']; + + // Check for "blank" = just user preference span - for some reason we can't match on the entity, so approximate + $regex = '/^/';//​/'; + if(strlen($html) == 75 && preg_match($regex,$html)) + { + return ''; + } $htmLawed = new egw_htmLawed(); if (is_array($config) && $_force===false) $config = array_merge($defaultConfig, $config); if (empty($config)) $config = $defaultConfig;