Merge pull request #1635 from RaspAP/fix/nordvpn-cli

Update parsing of NordVPN countries, fixes #1634
This commit is contained in:
Bill Zimmerman 2024-08-10 19:30:02 +02:00 committed by GitHub
commit a5e2d832ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,7 +102,7 @@ function DisplayProviderConfig()
} }
/** /**
* Validates VPN provider settings * Validates VPN provider settings
* *
* @param object $status * @param object $status
* @param string $binPath * @param string $binPath
@ -240,11 +240,9 @@ function getCountries($id, $binPath)
} }
break; break;
case 3: // nordvpn case 3: // nordvpn
$output = stripArtifacts($output,'\s');
$arrTmp = explode(",", $output[0]); $arrTmp = explode(",", $output[0]);
$countries = array_combine($arrTmp, $arrTmp); foreach ($output as $key => $value) {
foreach ($countries as $key => $value) { $countries[$value] = str_replace("_", " ", $value);
$countries[$key] = str_replace("_", " ", $value);
} }
break; break;
default: default: