fix QSO panel when using a date format with commas

Commas are not an allowed URI character, and so they need to be
replaced with a URI-safe stand in before being used. Of the default
URI-safe characters, only '~%:\' are not used yet. I chose to use '%'
as it seems the least likely to be used in any future date formats.

Closes #2343.
This commit is contained in:
Aaron Griffith
2025-09-24 08:43:58 -04:00
parent ee5f4d77a6
commit 62b5fc3e40
2 changed files with 10 additions and 1 deletions

View File

@@ -77,10 +77,14 @@ class Logbook extends CI_Controller {
// Normalize the date only if it's not empty
if (!empty($date)) {
// Characters '/' and ',' are not URL safe, so we replace
// them with '_' and '%'. Switch them back here.
if (strpos($date, '_') !== false) {
// Replace slashes with dashes for URL processing
$date = str_replace('_', '/', $date);
}
if (strpos($date, '%') !== false) {
$date = str_replace('%', ',', $date);
}
// Get user-preferred date format
if ($this->session->userdata('user_date_format')) {
$date_format = $this->session->userdata('user_date_format');