From 56f168a28087101f246e8642e8076b3e690db105 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Fri, 7 Apr 2023 21:29:12 -0400 Subject: [PATCH] remove trailing birdnet_url slash, if there is one --- scripts/advanced.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/advanced.php b/scripts/advanced.php index deeca88..03e60e9 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -52,6 +52,8 @@ if(isset($_GET['submit'])) { if(isset($_GET["birdnetpi_url"])) { $birdnetpi_url = $_GET["birdnetpi_url"]; + // remove trailing slash to prevent conf from becoming broken + $birdnetpi_url = rtrim($birdnetpi_url, '/'); if(strcmp($birdnetpi_url,$config['BIRDNETPI_URL']) !== 0) { $contents = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents); $contents2 = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents2);