From 3dc8b6db389bc3c64af721df00fcf5f0a9a8b740 Mon Sep 17 00:00:00 2001 From: frederik Date: Sat, 14 Sep 2024 10:20:16 +0200 Subject: [PATCH] fix: properly decode species so apostrophe in the name survives the url encode --- scripts/stats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stats.php b/scripts/stats.php index c099293..06fff9d 100644 --- a/scripts/stats.php +++ b/scripts/stats.php @@ -36,7 +36,7 @@ if(isset($_GET['sort']) && $_GET['sort'] == "occurrences") { if(isset($_GET['species'])){ - $selection = $_GET['species']; + $selection = htmlspecialchars_decode($_GET['species'], ENT_QUOTES); $statement3 = $db->prepare("SELECT Com_Name, Sci_Name, COUNT(*), MAX(Confidence), File_Name, Date, Time from detections WHERE Com_Name = \"$selection\""); ensure_db_ok($statement3); $result3 = $statement3->execute();