mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Miscellaneous fixes (#15162)
This commit is contained in:
@@ -58,13 +58,15 @@ class Clean
|
||||
* Clean a string for display in an html page.
|
||||
* For use in non-blade pages
|
||||
*
|
||||
* @param string $value
|
||||
* @param string|null $value
|
||||
* @param array $purifier_config (key, value pair)
|
||||
* @return string
|
||||
*/
|
||||
public static function html($value, $purifier_config = [])
|
||||
public static function html($value, $purifier_config = []): string
|
||||
{
|
||||
static $purifier;
|
||||
if (empty($value)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// If $purifier_config is non-empty then we don't want
|
||||
// to convert html tags and allow these to be controlled
|
||||
@@ -73,6 +75,8 @@ class Clean
|
||||
$value = htmlentities($value);
|
||||
}
|
||||
|
||||
static $purifier;
|
||||
|
||||
if (! $purifier instanceof HTMLPurifier) {
|
||||
// initialize HTML Purifier here since this is the only user
|
||||
$p_config = HTMLPurifier_Config::createDefault();
|
||||
|
Reference in New Issue
Block a user