From 601dfc33772b912e6c6f3ee288d310dfeae7eda4 Mon Sep 17 00:00:00 2001 From: jpawlowski Date: Sun, 3 Mar 2019 14:48:56 +0000 Subject: [PATCH] 70_Pushover: improved handling for absolute path of attachments git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18780 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/70_Pushover.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/FHEM/70_Pushover.pm b/FHEM/70_Pushover.pm index 91e7be61f..e73167687 100644 --- a/FHEM/70_Pushover.pm +++ b/FHEM/70_Pushover.pm @@ -1282,11 +1282,15 @@ sub Pushover_SetMessage2 ($$$$) { if ( defined( $values{attachment} ) ) { my $path = - "file://" - . AttrVal( $name, "storage", AttrVal( "global", "modpath", "." ) ); + AttrVal( $name, "storage", AttrVal( "global", "modpath", "." ) ); $path .= "/" unless ( $path =~ /\/$/ ); - $values{attachment} = $path . $values{attachment}; + $values{attachment} = "file://" + . ( + $values{attachment} =~ /^\// + ? $values{attachment} + : $path . $values{attachment} + ); } $body = Pushover_HttpForm( $body, $multipart, \%values );