57_Calendar: catch deadly regular expressions in get
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@8644 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1076,9 +1076,13 @@ sub Calendar_Get($@) {
|
|||||||
return "argument is missing" if($#a != 2);
|
return "argument is missing" if($#a != 2);
|
||||||
my $regexp= $a[2];
|
my $regexp= $a[2];
|
||||||
my @uids;
|
my @uids;
|
||||||
|
eval {
|
||||||
foreach my $event ($eventsObj->events()) {
|
foreach my $event ($eventsObj->events()) {
|
||||||
push @uids, $event->uid() if($event->summary() =~ m/$regexp/);
|
push @uids, $event->uid() if($event->summary() =~ m/$regexp/);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
Log3($hash, 2, "Calendar " . $hash->{NAME} .
|
||||||
|
": The regular expression $regexp caused a problem: $@") if($@);
|
||||||
return join(";", @uids);
|
return join(";", @uids);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user