From b9e4162635e8ab4b624ee9e10b9faf3729a89b29 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 27 Oct 2016 15:44:36 +0200 Subject: [PATCH] IcingaObject(legacy): Fix alignLegacyProperties for long attributes refs #12919 --- library/Director/Objects/IcingaObject.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index 10d1aa7f..9e0717ee 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -2085,11 +2085,13 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer foreach ($lines as &$line) { if (preg_match('/^\s{4}([^\t]+)\t+(.+)$/', $line, $m)) { if ($len - strlen($m[1]) < 0) { - var_dump($m); - exit; + $fill = ' '; + } + else { + $fill = str_repeat(' ', $len - strlen($m[1])); } - $line = ' ' . $m[1] . str_repeat(' ', $len - strlen($m[1])) . $m[2]; + $line = ' ' . $m[1] . $fill . $m[2]; } }