Merge pull request #3949 from Icinga/feature/relax-html-restrictions-for-plugin-output
PluginOutput: Relax html restrictions
This commit is contained in:
commit
97c1c4e215
|
@ -3,20 +3,13 @@
|
|||
|
||||
use Icinga\Web\Dom\DomNodeIterator;
|
||||
use Icinga\Web\View;
|
||||
use Icinga\Module\Monitoring\Web\Helper\PluginOutputPurifier;
|
||||
use Icinga\Web\Helper\HtmlPurifier;
|
||||
|
||||
/**
|
||||
* Plugin output renderer
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
@ -107,7 +100,7 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
|
|||
$output = preg_replace(
|
||||
self::$htmlPatterns,
|
||||
self::$htmlReplacements,
|
||||
PluginOutputPurifier::process($output)
|
||||
HtmlPurifier::process($output)
|
||||
);
|
||||
$isHtml = true;
|
||||
} 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…
Reference in New Issue