[icinga-checkins] icinga.org: icingaweb2/bugfix/ multi-line-strings-within-host-notes-are-being-displayed-as-single-line-12313 : NavigationItemRenderer: render newlines in labels as <br>

git at icinga.org git at icinga.org
Tue Oct 18 16:55:20 CEST 2016


Module: icingaweb2
Branch: bugfix/multi-line-strings-within-host-notes-are-being-displayed-as-single-line-12313
Commit: 05294e630bd84312cc2231dd15a9b11ff93e856c
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=05294e630bd84312cc2231dd15a9b11ff93e856c

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Tue Oct 18 16:53:59 2016 +0200

NavigationItemRenderer: render newlines in labels as <br>

refs #12313

---

 .../Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php b/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php
index e5866bc..cc54658 100644
--- a/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php
+++ b/library/Icinga/Web/Navigation/Renderer/NavigationItemRenderer.php
@@ -174,9 +174,12 @@ class NavigationItemRenderer
             );
         }
 
-        $label = $this->getEscapeLabel()
-            ? $this->view()->escape($item->getLabel())
-            : $item->getLabel();
+        $label = nl2br(
+            $this->getEscapeLabel()
+                ? $this->view()->escape($item->getLabel())
+                : $item->getLabel(),
+            false
+        );
         if (($icon = $item->getIcon()) !== null) {
             $label = $this->view()->icon($icon) . $label;
         }



More information about the icinga-checkins mailing list