From becabbcd1af4a2c81b7075b4fedd614840141423 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 26 Apr 2023 14:54:02 -0400 Subject: [PATCH] Make objdetect attachments have unique filename --- scripts/zmfilter.pl.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index 1213d2de9..9703c8e0c 100644 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -797,7 +797,7 @@ sub substituteTags { if ($text =~ /%EIMOD%/g ) { my $path = $Event->Path().'/objdetect.jpg'; if (-e $path) { - my $filename = fileparse($path); + my $filename = $Event->Id().'_'.fileparse($path); my $attachment = { type=>'image/jpeg', path=>$path, content_id=>uri_encode($filename) }; push @$attachments_ref, $attachment if !is_in_attachments($path, $attachments_ref); $text =~ s/%EIMOD%//g; @@ -810,7 +810,7 @@ sub substituteTags { if ( $text =~ s/%EIMODG%//g ) { my $path = $Event->Path().'/objdetect.gif'; if ( -e $path ) { - my $filename = fileparse($path); + my $filename = $Event->Id().'_'.fileparse($path); my $attachment = { type=>'image/gif', path=>$path, content_id=>uri_encode($filename) }; push @$attachments_ref, $attachment if !is_in_attachments($path, $attachments_ref); $text =~ s/%EIMODG%//g;