diff --git a/scripts/plotly_streamlit.py b/scripts/plotly_streamlit.py index 8d8e584..b122703 100755 --- a/scripts/plotly_streamlit.py +++ b/scripts/plotly_streamlit.py @@ -364,7 +364,7 @@ if daily is False: recording = st.selectbox('Available recordings', recordings.sort_index(ascending=False)) date_specie = df2.loc[df2['File_Name'] == recording, ['Date', 'Com_Name']] date_dir = date_specie['Date'].values[0] - specie_dir = date_specie['Com_Name'].values[0].replace(" ", "_") + specie_dir = date_specie['Com_Name'].values[0].replace(" ", "_").replace("'", "") st.image(userDir + '/BirdSongs/Extracted/By_Date/' + date_dir + '/' + specie_dir + '/' + recording + '.png') st.audio(userDir + '/BirdSongs/Extracted/By_Date/' + date_dir + '/' + specie_dir + '/' + recording) except Exception: 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();