Merge pull request #3949 from Icinga/feature/relax-html-restrictions-for-plugin-output

PluginOutput: Relax html restrictions
This commit is contained in:
Johannes Meyer 2019-09-26 14:33:14 +02:00 committed by GitHub
commit 97c1c4e215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 26 deletions

View File

@ -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 {

View File

@ -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]'
);
}
}