2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 07:56:03 +00:00

fhem.pl: better NL handling for userattr (Forum #42431)

git-svn-id: https://svn.fhem.de/fhem/trunk@19259 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2019-04-25 06:38:44 +00:00
parent 244e4b9024
commit 24e2108176

View File

@ -2682,8 +2682,16 @@ getAllAttr($;$)
} elsif($modules{$defs{$d}{TYPE}}{AttrList}) { } elsif($modules{$defs{$d}{TYPE}}{AttrList}) {
$list .= " " . $modules{$defs{$d}{TYPE}}{AttrList}; $list .= " " . $modules{$defs{$d}{TYPE}}{AttrList};
} }
$list .= " " . $attr{global}{userattr} if($attr{global}{userattr});
$list .= " " . $attr{$d}{userattr} if($attr{$d} && $attr{$d}{userattr}); my $nl2space = sub($)
{
my $v = $_[0];
return if(!defined($v));
$v =~ s/\n/ /g;
$list .= " $v";
};
$nl2space->($attr{global}{userattr});
$nl2space->($attr{$d}{userattr}) if($attr{$d});
$list .= " userattr"; $list .= " userattr";
return $list; return $list;
} }