From 89cb4621fad67172a293b887e17f95b284b5642c Mon Sep 17 00:00:00 2001 From: billz Date: Fri, 1 Dec 2023 14:18:38 +0000 Subject: [PATCH] Version compatibility check for isoquery options --- includes/functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 6a17e4fb4..4d5c5b3cd 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -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);