IcingaObject(legacy): Fix alignLegacyProperties for long attributes

refs #12919
This commit is contained in:
Markus Frosch 2016-10-27 15:44:36 +02:00
parent e368b32ec6
commit b9e4162635
1 changed files with 5 additions and 3 deletions

View File

@ -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];
}
}