From 24e21081760861f1f36b9f68f1e0ea408e9cca4c Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 25 Apr 2019 06:38:44 +0000 Subject: [PATCH] fhem.pl: better NL handling for userattr (Forum #42431) git-svn-id: https://svn.fhem.de/fhem/trunk@19259 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index dfa48f343..ee2e80eba 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -2682,8 +2682,16 @@ getAllAttr($;$) } elsif($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"; return $list; }