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.
这个提交包含在:
父节点
485fa0126d
当前提交
c9490b9fc8
共有 1 个文件被更改,包括 10 次插入 和 1 次删除
|
|
@ -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();
|
||||
|
|
|
|||
正在加载…
在新工单中引用