A live bird collage card for your Home Assistant dashboard.
make sure multiline works with the test function
frederik6fb19bc7ab05
diff --git a/scripts/config.php b/scripts/config.phpindex eeb341a7..7892b995 100644--- a/scripts/config.php+++ b/scripts/config.php@@ -63,7 +63,7 @@ if(isset($_GET["latitude"])){$birdweather_id = $_GET["birdweather_id"];$apprise_input = $_GET['apprise_input'];$apprise_notification_title = $_GET['apprise_notification_title'];- $apprise_notification_body = $_GET['apprise_notification_body'];+ $apprise_notification_body = htmlspecialchars_decode($_GET['apprise_notification_body'], ENT_QUOTES);$minimum_time_limit = $_GET['minimum_time_limit'];$image_provider = $_GET["image_provider"];$flickr_api_key = $_GET['flickr_api_key'];@@ -262,7 +262,7 @@ function sendTestNotification(e) {e.classList.add("disabled");var apprise_notification_title = document.getElementsByName("apprise_notification_title")[0].value;- var apprise_notification_body = document.getElementsByName("apprise_notification_body")[0].value;+ var apprise_notification_body = encodeURIComponent(document.getElementsByName("apprise_notification_body")[0].value);var apprise_config = encodeURIComponent(document.getElementsByName("apprise_input")[0].value);var xmlHttp = new XMLHttpRequest();@@ -272,7 +272,7 @@ function sendTestNotification(e) {e.classList.remove("disabled");}}- xmlHttp.open("GET", "scripts/config.php?sendtest=true&apprise_notification_title="+apprise_notification_title+"&apprise_notification_body="+apprise_notification_body+"&apprise_config="+apprise_config, true); // true for asynchronous+ xmlHttp.open("GET", "scripts/config.php?sendtest=true"+"&apprise_notification_body="+apprise_notification_body+"&apprise_config="+apprise_config+"&apprise_notification_title="+apprise_notification_title, true); // true for asynchronousxmlHttp.send(null);}</script>@@ -491,7 +491,7 @@ https://discordapp.com/api/webhooks/{WebhookID}/{WebhookToken}<label for="apprise_notification_title">Notification Title: </label><input name="apprise_notification_title" style="width: 100%" type="text" value="<?php print($config['APPRISE_NOTIFICATION_TITLE']);?>" /><br><label for="apprise_notification_body">Notification Body: </label>- <textarea name="apprise_notification_body" style="width: 100%" rows="5" type="text" ><?php print($apprise_notification_body);?></textarea>+ <textarea name="apprise_notification_body" rows="5" type="text" ><?php print($apprise_notification_body);?></textarea><input type="checkbox" name="apprise_notify_new_species" <?php if($config['APPRISE_NOTIFY_NEW_SPECIES'] == 1 && filesize($home."/BirdNET-Pi/apprise.txt") != 0) { echo "checked"; };?> ><label for="apprise_notify_new_species">Notify each new infrequent species detection (<5 visits per week)</label><br><input type="checkbox" name="apprise_notify_new_species_each_day" <?php if($config['APPRISE_NOTIFY_NEW_SPECIES_EACH_DAY'] == 1 && filesize($home."/BirdNET-Pi/apprise.txt") != 0) { echo "checked"; };?> >