cloudlog/application/helpers/useragent_helper.php
Peter Goodhall e6aeee53a1 Add reusable User-Agent helper for QRZ API requests
Introduced a useragent_helper with a function to generate a compliant User-Agent string for Cloudlog, and updated QRZ API calls in Qrz controller and Logbook_model to use this helper. This ensures consistent and QRZ-compliant User-Agent headers for all outgoing requests.
2026-01-09 10:52:37 +00:00

16 lines
482 B
PHP

<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
if (!function_exists('cloudlog_user_agent')) {
function cloudlog_user_agent(): string {
$CI = &get_instance();
if (!isset($CI->optionslib)) {
$CI->load->library('optionslib');
}
$version = $CI->optionslib->get_option('version');
$ua = 'Cloudlog';
if (!empty($version)) {
$ua .= '/' . $version;
}
return $ua;
}
}