mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: move HTMLPurifier init to init.php so we only create one object. (#5601)
This commit is contained in:
committed by
Neil Lathwood
parent
7bae2cf0a7
commit
59706194bf
@ -1503,10 +1503,8 @@ function clean($value)
|
|||||||
*/
|
*/
|
||||||
function display($value)
|
function display($value)
|
||||||
{
|
{
|
||||||
global $config;
|
/** @var HTMLPurifier $purifier */
|
||||||
$p_config = HTMLPurifier_Config::createDefault();
|
global $purifier;
|
||||||
$p_config->set('Cache.SerializerPath', $config['temp_dir']);
|
|
||||||
$purifier = new HTMLPurifier($p_config);
|
|
||||||
return $purifier->purify(stripslashes($value));
|
return $purifier->purify(stripslashes($value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +135,11 @@ if (module_selected('web', $init_modules)) {
|
|||||||
$os_list[] = $config['install_dir'].'/includes/definitions/'. $v['os'] . '.yaml';
|
$os_list[] = $config['install_dir'].'/includes/definitions/'. $v['os'] . '.yaml';
|
||||||
}
|
}
|
||||||
load_all_os($os_list);
|
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();
|
$console_color = new Console_Color2();
|
||||||
|
Reference in New Issue
Block a user