mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
70_Pushover: allow \n to enforce newlines in message text and \\n to keep it as \n
git-svn-id: https://svn.fhem.de/fhem/trunk@10043 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ceba17c545
commit
1dcd8c22d6
@ -782,11 +782,11 @@ sub Pushover_SetMessage {
|
||||
Log3 $name, 4,
|
||||
"Pushover $name: explicitly ignoring HTML tags in message";
|
||||
$values{message} =~ s/^(nohtml:).*//;
|
||||
$body = $body . "&message=" . urlEncode( $values{message} );
|
||||
}
|
||||
else {
|
||||
$body = $body . "&message=" . urlEncode( $values{message} );
|
||||
}
|
||||
$values{message} = urlEncode( $values{message} );
|
||||
$values{message} =~ s/(?<!%5c)(%5cn)/%0a/g; # replace any URL-encoded \n with their hex equivalent but ignore \\n
|
||||
$values{message} =~ s/%5c%5cn/%5cn/g; # replace any URL-encoded \\n with \n
|
||||
$body = $body . "&message=" . $values{message};
|
||||
|
||||
if ( $values{device} ne "" ) {
|
||||
$body = $body . "&device=" . $values{device};
|
||||
|
Loading…
x
Reference in New Issue
Block a user