mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added another layer for 1 char suffixes
This commit is contained in:
@@ -195,6 +195,14 @@ class Dxcc {
|
||||
return null; # exit, undef
|
||||
}
|
||||
|
||||
if (preg_match('/^[0-9]{2,}$/', $c)) { # If suffix consists of two or more digits -> ignore suffix, To catch callsigns like VP8ADR/40
|
||||
$c = null;
|
||||
}
|
||||
|
||||
if (preg_match('/^[A-Z]{1}$/', ($c ?? ''))) { # If suffix consists of exactly one letter -> ignore suffix, To catch callsigns like LU7CC/E
|
||||
$c = null;
|
||||
}
|
||||
|
||||
# Depending on these values we have to determine the prefix.
|
||||
# Following cases are possible:
|
||||
#
|
||||
@@ -280,8 +288,8 @@ class Dxcc {
|
||||
$prefix = $matches[1];
|
||||
} elseif (preg_match($this->noneadditions, $c)) {
|
||||
return '';
|
||||
} elseif (preg_match('/^\d\d+$/', $c)) { # more than 2 numbers -> ignore
|
||||
if (!preg_match('/(.+\d)[A-Z]* /', $b, $matches)) {
|
||||
} elseif (preg_match('/^\d\d+$/', $c)) { # more than 2 numbers -> ignore
|
||||
if (!preg_match('/(.+\d)[A-Z]*/', $b, $matches)) {
|
||||
$this->logError('preg_match failed for multi-digit case', [
|
||||
'testcall' => $testcall,
|
||||
'b' => $b,
|
||||
@@ -303,7 +311,7 @@ class Dxcc {
|
||||
$prefix = $c . "0";
|
||||
}
|
||||
}
|
||||
} elseif (($a) && (preg_match($this->noneadditions, $c))) { # Case 2.1, X/CALL/X ie TF/DL2NWK/MM - DXCC none
|
||||
} elseif (($a) && (preg_match($this->noneadditions, ($c ?? '')))) { # Case 2.1, X/CALL/X ie TF/DL2NWK/MM - DXCC none
|
||||
return '';
|
||||
} elseif ($a) {
|
||||
# $a contains the prefix we want
|
||||
|
||||
Reference in New Issue
Block a user