mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
fix: html purify init wasn't done always when it was used (#5626)
This commit is contained in:
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));
|
||||
}
|
||||
|
||||
|
@ -135,11 +135,6 @@ if (module_selected('web', $init_modules)) {
|
||||
$os_list[] = $config['install_dir'].'/includes/definitions/'. $v['os'] . '.yaml';
|
||||
}
|
||||
load_all_os($os_list);
|
||||
|
||||
// initialize HTML Purifier
|
||||
$p_config = HTMLPurifier_Config::createDefault();
|
||||
$p_config->set('Cache.SerializerPath', $config['temp_dir']);
|
||||
$purifier = new HTMLPurifier($p_config);
|
||||
}
|
||||
|
||||
$console_color = new Console_Color2();
|
||||
|
Loading…
Reference in New Issue
Block a user