fhem.pl: check for bad regexp in deletereading (Forum #31165)

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7358 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2014-12-29 16:03:31 +00:00
parent 4715d90419
commit 4a23a487d0

View File

@@ -1833,6 +1833,9 @@ CommandDeleteReading($$)
my @a = split(" ", $def, 2);
return "Usage: deletereading <name> <reading>\n$namedef" if(@a != 2);
eval { "" =~ m/$a[1]/ };
return "Bad regexp $a[1]: $@" if($@);
%ntfyHash = ();
my @rets;
foreach my $sdev (devspec2array($a[0])) {