Handle entity type when formatting country name

Updated country name formatting to support both array and object types for the entity returned by get_entity. This ensures compatibility with different data structures and prevents errors when accessing the country name.
这个提交包含在:
Peter Goodhall 2025-08-17 11:32:18 +01:00
父节点 485fa0126d
当前提交 c9490b9fc8

查看文件

@ -1087,7 +1087,16 @@ class Logbook_model extends CI_Model
$entity = $this->get_entity($this->input->post('dxcc_id'));
$stationId = $this->input->post('station_profile');
$country = ucwords(strtolower($entity['name']), "- (/");
if (is_array($entity)) {
$rawCountry = $entity['name'] ?? '';
} elseif (is_object($entity)) {
$rawCountry = $entity->name ?? '';
} else {
$rawCountry = (string)$entity;
}
$country = ucwords(strtolower($rawCountry), "- (/"
);
// be sure that station belongs to user
$CI = &get_instance();