Fix location_code filter: handle empty string and trim whitespace

This commit is contained in:
mwpn
2025-12-17 17:55:00 +07:00
parent a1a9dd93f8
commit 2760f1a8f7

View File

@@ -169,8 +169,10 @@ class RealtimeController
}
$locationCode = $queryParams['location_code'] ?? null;
if ($locationCode !== null && !is_string($locationCode)) {
if ($locationCode !== null && (!is_string($locationCode) || trim($locationCode) === '')) {
$locationCode = null;
} else if ($locationCode !== null) {
$locationCode = trim($locationCode);
}
try {