[icinga-checkins] icinga.org: icingaweb2/bugfix/copy-paste-plugin-output-12134: Wrap zero width space in hidden span

git at icinga.org git at icinga.org
Thu Jul 21 10:57:38 CEST 2016


Module: icingaweb2
Branch: bugfix/copy-paste-plugin-output-12134
Commit: 733696864e832d73c1ac383aa48fcd8c0b341462
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=733696864e832d73c1ac383aa48fcd8c0b341462

Author: Eric Lippmann <eric.lippmann at netways.de>
Date:   Thu Jul 21 10:56:32 2016 +0200

Wrap zero width space in hidden span

This should fix copy and paste issues but still help browsers to nicely break lines in plugin output.

refs #12134

---

 modules/monitoring/application/views/helpers/PluginOutput.php |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/monitoring/application/views/helpers/PluginOutput.php b/modules/monitoring/application/views/helpers/PluginOutput.php
index 215ad5a..404c915 100644
--- a/modules/monitoring/application/views/helpers/PluginOutput.php
+++ b/modules/monitoring/application/views/helpers/PluginOutput.php
@@ -66,7 +66,12 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
     {
         // This is actually not required as the value is constant,
         // but as its (visual) length is 0, it's likely to be mixed up with the empty string.
-        $this->zeroWidthSpace = html_entity_decode($this->zeroWidthSpaceEnt, ENT_NOQUOTES, 'UTF-8');
+        $this->zeroWidthSpace = '<span style="visibility:hidden; display:none;">'
+            . html_entity_decode($this->zeroWidthSpaceEnt, ENT_NOQUOTES, 'UTF-8')
+            . '</span>';
+        $this->zeroWidthSpaceEnt = '<span style="visibility:hidden; display:none;">'
+            . $this->zeroWidthSpaceEnt
+            . '</span>';
     }
 
     /**



More information about the icinga-checkins mailing list