Skip to content

Commit

Permalink
Merge pull request #1468 from RaspAP/fix/isoquery-opts
Browse files Browse the repository at this point in the history
Fix: Version compatibility check for isoquery options
  • Loading branch information
billz authored Dec 4, 2023
2 parents ff7f1f0 + 89cb462 commit 7e39bc0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -874,10 +874,15 @@ function loadFooterScripts($extraFooterScripts)
*
* @param string $locale
* @param boolean $flag
* @see https://salsa.debian.org/debian/isoquery/
*/
function getCountryCodes($locale = 'en', $flag = true) {
define("FLAG_SUPPORT", "3.3.0");
$output = [];
if ($flag) {
$version = shell_exec("isoquery --version | grep -oP '(?<=isoquery )\d+\.\d+\.\d+'");
$compat = checkReleaseVersion(FLAG_SUPPORT, $version);

if ($flag && $compat) {
$opt = '--flag';
}
exec("isoquery $opt --locale $locale | awk -F'\t' '{print $5 \"\t\" $0}' | sort | cut -f2-", $output);
Expand Down

0 comments on commit 7e39bc0

Please sign in to comment.