From d228a33ff14647272cd10e960f88399c96a6723f Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 24 Nov 2009 11:18:06 +0000 Subject: [PATCH] take care that charset and tempdir have appropriate values, no matter if they are initialized at the time --- phpgwapi/inc/class.html.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index b85a27ce99..a1b9abcfd5 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -1274,7 +1274,7 @@ class html if (is_null($config)) { $config = HTMLPurifier_Config::createDefault(); - $config->set('Core', 'Encoding', self::$charset); + $config->set('Core', 'Encoding', (self::$charset?self::$charset:'UTF-8')); // maybe the two following lines are useful for caching??? $config->set('HTML','DefinitionID', 'egroupware'); $config->set('HTML','DefinitionRev', 1); @@ -1296,7 +1296,7 @@ class html 'td[class|colspan|rowspan|width|style|align|bgcolor|align|valign|nowrap],'. 'th[class|colspan|rowspan|width|style|align|bgcolor|align|valign|nowrap],'. 'a[href|target|name|title],img[src|alt|title]'); - $config->set('Cache', 'SerializerPath', $GLOBALS['egw_info']['server']['temp_dir']); + $config->set('Cache', 'SerializerPath', ($GLOBALS['egw_info']['server']['temp_dir']?$GLOBALS['egw_info']['server']['temp_dir']:sys_get_temp_dir())); } $purifier = new HTMLPurifier($config); // the latter may enable you to modify the config later on, but by now