diff --git a/modules/monitoring/application/views/helpers/PluginOutput.php b/modules/monitoring/application/views/helpers/PluginOutput.php index ba3013a3a..b78417db0 100644 --- a/modules/monitoring/application/views/helpers/PluginOutput.php +++ b/modules/monitoring/application/views/helpers/PluginOutput.php @@ -27,6 +27,16 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract '@@@@@@', ); + /** + * @var string + */ + protected $zeroWidthSpace; + + public function __construct() + { + $this->zeroWidthSpace = html_entity_decode('', ENT_NOQUOTES, 'UTF-8'); + } + public function pluginOutput($output, $raw = false) { if (empty($output)) { @@ -50,15 +60,11 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract ); $isHtml = false; } - $output = $this->fixLinks($output); + $output = $this->fixLinksAndWrapping($output); // Help browsers to break words in plugin output $output = trim($output); // Add space after comma where missing $output = preg_replace('/,[^\s]/', ', ', $output); - // Add zero width space after ')', ']', ':', '.', '_' and '-' if not surrounded by whitespaces - $output = preg_replace('/([^\s])([\\)\\]:._-])([^\s])/', '$1$2$3', $output); - // Add zero width space before '(' and '[' if not surrounded by whitespaces - $output = preg_replace('/([^\s])([([])([^\s])/', '$1$2$3', $output); if (! $raw) { if ($isHtml) { @@ -70,13 +76,14 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract return $output; } - protected function fixLinks($html) + protected function fixLinksAndWrapping($html) { $ret = array(); $dom = new DOMDocument; $dom->loadXML('