From fff07144c36a5dbf3dded95c28e87b76c19bb6cc Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 1 Mar 2019 14:59:55 +0100 Subject: [PATCH 1/2] Preserve
s in plugin output refs #3662 --- .../monitoring/application/views/helpers/PluginOutput.php | 1 - .../php/application/views/helpers/PluginOutputTest.php | 8 +++----- 2 files changed, 3 insertions(+), 6 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..8d8f4f2cd 100644 --- a/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php +++ b/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php @@ -92,15 +92,13 @@ class PluginOutputTest extends BaseTestCase ); /** @noinspection HtmlUnknownAttribute */ $output = array( - 'Teststatus', - ']*>Info', - '', - '', + 'Teststatus ', + ']*>Info

', ']*>Info2' ); $this->checkHtmlOutput( join("\n", $input), - join("\n", $output), + join('', $output), true ); } From eb69a249d3e68ac0e878a6072a41f8021f43349e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 11 Apr 2019 14:15:15 +0200 Subject: [PATCH 2/2] PluginOutputTest: Fix case testMultilineHtmlOutput --- .../application/views/helpers/PluginOutputTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php b/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php index 8d8f4f2cd..2203333d7 100644 --- a/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php +++ b/modules/monitoring/test/php/application/views/helpers/PluginOutputTest.php @@ -87,18 +87,18 @@ class PluginOutputTest extends BaseTestCase { $input = array( 'Teststatus', - 'Info

', - 'Info2' + 'Info

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

', - ']*>Info2' + 'Teststatus', + ']*>Info

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