From 1c41fc3d8f409bb549a547f98bd9f8631ce9eb04 Mon Sep 17 00:00:00 2001 From: frederik Date: Tue, 23 Apr 2024 19:26:08 +0200 Subject: [PATCH] properly replace quotes --- scripts/play.php | 3 ++- scripts/todays_detections.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/play.php b/scripts/play.php index 34340af..bf6df3c 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 02ee33b..f7f3f68 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']);