mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: html purify init wasn't done always when it was used (#5626)
This commit is contained in:
committed by
Neil Lathwood
parent
08edfc60e0
commit
2f1095cb8d
@@ -1504,7 +1504,14 @@ function clean($value)
|
||||
function display($value)
|
||||
{
|
||||
/** @var HTMLPurifier $purifier */
|
||||
global $purifier;
|
||||
global $config, $purifier;
|
||||
if (!isset($purifier)) {
|
||||
// initialize HTML Purifier here since this is the only user
|
||||
$p_config = HTMLPurifier_Config::createDefault();
|
||||
$p_config->set('Cache.SerializerPath', $config['temp_dir']);
|
||||
$purifier = new HTMLPurifier($p_config);
|
||||
}
|
||||
|
||||
return $purifier->purify(stripslashes($value));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user