Merge pull request #3622 from Icinga/fix/plugin-output-extra-spaces

Fix extra spaces in command outputs after a comma
This commit is contained in:
Eric Lippmann 2018-11-21 09:19:00 +01:00 committed by GitHub
commit 63cb9d7283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -120,8 +120,9 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
$isHtml = false;
}
$output = trim($output);
// Add space after comma where missing, to help browsers to break words in plugin output
$output = preg_replace('/,(?=[^\s])/', ', ', $output);
// Add zero-width space after commas which are not followed by a whitespace character
// in oder to help browsers to break words in plugin output
$output = preg_replace('/,(?=[^\s])/', ',​', $output);
if (! $raw) {
if ($isHtml) {
$output = $this->processHtml($output);