Skip to content

A live bird collage card for your Home Assistant dashboard.

properly replace quotes

frederik1c41fc3d8f40
diff --git a/scripts/play.php b/scripts/play.php
index 34340af6..bf6df3c8 100644
--- a/scripts/play.php
+++ b/scripts/play.php
@@ -325,7 +325,8 @@ if(!isset($_GET['species']) && !isset($_GET['filename'])){
while($results=$result->fetchArray(SQLITE3_ASSOC))
{
$name = $results['Com_Name'];
- if(realpath($home."/BirdSongs/Extracted/By_Date/".$date."/".str_replace(" ", "_",$name)) !== false){
+ $dir_name = str_replace("'", '', $name);
+ if(realpath($home."/BirdSongs/Extracted/By_Date/".$date."/".str_replace(" ", "_", $dir_name)) !== false){
$birds[] = $name;
}
}
diff --git a/scripts/todays_detections.php b/scripts/todays_detections.php
index 02ee33bd..f7f3f685 100644
--- a/scripts/todays_detections.php
+++ b/scripts/todays_detections.php
@@ -192,7 +192,7 @@ if(isset($_GET['ajax_detections']) && $_GET['ajax_detections'] == "true" ) {
$iterations++;
$comname = preg_replace('/ /', '_', $todaytable['Com_Name']);
- $comname = preg_replace('/\'/', '_', $comname);
+ $comname = preg_replace('/\'/', '', $comname);
$filename = "/By_Date/".date('Y-m-d')."/".$comname."/".$todaytable['File_Name'];
$filename_formatted = $todaytable['Date']."/".$comname."/".$todaytable['File_Name'];
$sciname = preg_replace('/ /', '_', $todaytable['Sci_Name']);