From dd1fd2eb71805753520583e7bc6dda878cb0411e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 11 Apr 2019 14:31:38 +0200 Subject: [PATCH] Merge pull request #3704 from Icinga/bugfix/br-in-plugin-output-3662 Preserve
s in plugin output (cherry picked from commit 33f7d0b8e6544d3c2b0720add2c11c0a8975e456) Signed-off-by: Johannes Meyer --- .../application/views/helpers/PluginOutput.php | 1 - .../php/application/views/helpers/PluginOutputTest.php | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/views/helpers/PluginOutput.php b/modules/monitoring/application/views/helpers/PluginOutput.php index 1cafcc335..78eae2aef 100644 --- a/modules/monitoring/application/views/helpers/PluginOutput.php +++ b/modules/monitoring/application/views/helpers/PluginOutput.php @@ -102,7 +102,6 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract if ($command !== null) { $output = $this->hookRenderer->render($command, $output, ! $raw); } - $output = preg_replace('~]*>~', "\n", $output); if (preg_match('~<[^>]*["/\'][^>]*>~', $output)) { // HTML $output = preg_replace( diff --git a/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php b/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php index 6e136c9f8..2203333d7 100644 --- a/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php +++ b/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php @@ -87,16 +87,14 @@ class PluginOutputTest extends BaseTestCase { $input = array( 'Teststatus', - 'Info

', - 'Info2' + 'Info

' + . 'Info2' ); /** @noinspection HtmlUnknownAttribute */ $output = array( 'Teststatus', - ']*>Info', - '', - '', - ']*>Info2' + ']*>Info

' + . ']*>Info2' ); $this->checkHtmlOutput( join("\n", $input),