PluginOutput: Fix that subsequent escaped newlines are not transformed

fixes #4297
This commit is contained in:
Johannes Meyer 2021-02-15 10:22:21 +01:00
parent a6e4307886
commit e01f51ffc7
2 changed files with 12 additions and 4 deletions

View File

@ -16,9 +16,9 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
* @var array
*/
protected static $txtPatterns = array(
'~\\\n~',
'~\\\n\\\n~',
'~\\\t~',
'~\\\n\\\n~',
'~\\\n~',
'~(\[|\()OK(\]|\))~',
'~(\[|\()WARNING(\]|\))~',
'~(\[|\()CRITICAL(\]|\))~',
@ -52,9 +52,9 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
* @var array
*/
protected static $htmlPatterns = array(
'~\\\n~',
'~\\\t~',
'~\\\n\\\n~',
'~\\\t~',
'~\\\n~',
'~<table~'
);

View File

@ -65,6 +65,14 @@ class PluginOutputTest extends BaseTestCase
);
}
public function testOutputWithNewlines()
{
$this->checkOutput(
'foo\nbar\n\nraboof',
"foo\nbar\nraboof"
);
}
public function testOutputWithHtmlEntities()
{
$this->checkOutput(