mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 05:44:36 +02:00
PluginOutput: Relax html restrictions
This commit is contained in:
parent
c3603c991d
commit
ab99d25cb5
@ -3,20 +3,13 @@
|
|||||||
|
|
||||||
use Icinga\Web\Dom\DomNodeIterator;
|
use Icinga\Web\Dom\DomNodeIterator;
|
||||||
use Icinga\Web\View;
|
use Icinga\Web\View;
|
||||||
use Icinga\Module\Monitoring\Web\Helper\PluginOutputPurifier;
|
use Icinga\Web\Helper\HtmlPurifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin output renderer
|
* Plugin output renderer
|
||||||
*/
|
*/
|
||||||
class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
|
class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* The return value of getPurifier()
|
|
||||||
*
|
|
||||||
* @var HTMLPurifier
|
|
||||||
*/
|
|
||||||
protected static $purifier;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patterns to be replaced in plain text plugin output
|
* Patterns to be replaced in plain text plugin output
|
||||||
*
|
*
|
||||||
@ -107,7 +100,7 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
|
|||||||
$output = preg_replace(
|
$output = preg_replace(
|
||||||
self::$htmlPatterns,
|
self::$htmlPatterns,
|
||||||
self::$htmlReplacements,
|
self::$htmlReplacements,
|
||||||
PluginOutputPurifier::process($output)
|
HtmlPurifier::process($output)
|
||||||
);
|
);
|
||||||
$isHtml = true;
|
$isHtml = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
<?php
|
|
||||||
/* Icinga Web 2 | (c) 2018 Icinga Development Team | GPLv2+ */
|
|
||||||
|
|
||||||
namespace Icinga\Module\Monitoring\Web\Helper;
|
|
||||||
|
|
||||||
use Icinga\Web\Helper\HtmlPurifier;
|
|
||||||
|
|
||||||
class PluginOutputPurifier extends HtmlPurifier
|
|
||||||
{
|
|
||||||
protected function configure($config)
|
|
||||||
{
|
|
||||||
$config->set(
|
|
||||||
'HTML.Allowed',
|
|
||||||
'p,br,b,a[href|target],i,ul,ol,li,table,tr,th[colspan],td[colspan],div,span,*[class|style]'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user