Remove htmlspecialchars

Removed htmlspecialchars encoding for common and scientific names, and adjusted last seen display.
This commit is contained in:
Alexandre
2025-10-29 09:04:50 +01:00
committed by Nachtzuster
parent 3465305fd6
commit 24461bb679
+4 -6
View File
@@ -201,8 +201,8 @@ $result = $db->query($sql);
</thead> </thead>
<tbody> <tbody>
<?php while ($row = $result->fetchArray(SQLITE3_ASSOC)) { <?php while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
$common = htmlspecialchars($row['Com_Name'], ENT_QUOTES); $common = $row['Com_Name'];
$scient = htmlspecialchars($row['Sci_Name'], ENT_QUOTES); $scient = $row['Sci_Name'];
$count = (int)$row['Count']; $count = (int)$row['Count'];
$max_confidence = round((float)$row['MaxConfidence'] * 100, 1); $max_confidence = round((float)$row['MaxConfidence'] * 100, 1);
$identifier = $row['Sci_Name'].'_'.$row['Com_Name']; $identifier = $row['Sci_Name'].'_'.$row['Com_Name'];
@@ -210,7 +210,6 @@ $result = $db->query($sql);
$lastSeen = $row['LastSeen'] ?? ''; $lastSeen = $row['LastSeen'] ?? '';
$lastSeenSort = $lastSeen ? (strtotime($lastSeen) ?: 0) : 0; $lastSeenSort = $lastSeen ? (strtotime($lastSeen) ?: 0) : 0;
$lastSeenDisplay = htmlspecialchars($lastSeen, ENT_QUOTES);
$common_link = "<a href='views.php?view=Recordings&species=" . rawurlencode($row['Sci_Name']) . "'>{$common}</a>"; $common_link = "<a href='views.php?view=Recordings&species=" . rawurlencode($row['Sci_Name']) . "'>{$common}</a>";
@@ -240,8 +239,7 @@ $result = $db->query($sql);
$info_url = get_info_url($sciname_raw); $info_url = get_info_url($sciname_raw);
if (!empty($info_url)) { if (!empty($info_url)) {
$url = $info_url['URL'] ?? $info_url; $url = $info_url['URL'] ?? $info_url;
$url_esc = htmlspecialchars($url, ENT_QUOTES); $scient_link = "<a href=\"{$url}\" target=\"_blank\"><i>{$scient}</i></a>";
$scient_link = "<a href=\"{$url_esc}\" target=\"_blank\"><i>{$scient}</i></a>";
} else { } else {
$scient_link = "<i>{$scient}</i>"; $scient_link = "<i>{$scient}</i>";
} }
@@ -252,7 +250,7 @@ $result = $db->query($sql);
. "<td>{$chart_cell}</td>" . "<td>{$chart_cell}</td>"
. "<td>{$count}</td>" . "<td>{$count}</td>"
. "<td data-sort='{$max_confidence}'>{$max_confidence}%</td>" . "<td data-sort='{$max_confidence}'>{$max_confidence}%</td>"
. "<td data-sort=\"{$lastSeenSort}\">{$lastSeenDisplay}</td>" . "<td data-sort=\"{$lastSeenSort}\">{$lastSeen}</td>"
. "<td class='threshold' data-sort='0'>0.0000</td>" . "<td class='threshold' data-sort='0'>0.0000</td>"
. "<td data-sort='".($is_confirmed?0:1)."'>".$confirm_cell."</td>" . "<td data-sort='".($is_confirmed?0:1)."'>".$confirm_cell."</td>"
. "<td data-sort='".($is_excluded?0:1)."'>".$excl_cell."</td>" . "<td data-sort='".($is_excluded?0:1)."'>".$excl_cell."</td>"