mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-22 17:52:16 +00:00
[QRZ] Clean Gridsquare to allow only 8 character's max
This commit is contained in:
parent
37281f8fe6
commit
563f3d5b69
@ -82,7 +82,12 @@ class Qrz {
|
||||
$data['name'] = (string)$xml->Callsign->fname;
|
||||
}
|
||||
$data['name'] = trim($data['name']);
|
||||
$data['gridsquare'] = (string)$xml->Callsign->grid;
|
||||
|
||||
// Sanitise gridsquare to only allow up to 8 characters
|
||||
$unclean_gridsquare = (string)$xml->Callsign->grid; // Get the gridsquare from QRZ convert to string
|
||||
$clean_gridsquare = strlen($unclean_gridsquare) > 8 ? substr($unclean_gridsquare,0,8) : $unclean_gridsquare; // Trim gridsquare to 8 characters max
|
||||
$data['gridsquare'] = $clean_gridsquare;
|
||||
|
||||
$data['city'] = (string)$xml->Callsign->addr2;
|
||||
$data['lat'] = (string)$xml->Callsign->lat;
|
||||
$data['long'] = (string)$xml->Callsign->lon;
|
||||
|
Loading…
Reference in New Issue
Block a user