From c96ba25f5be748b316faa8725b1b3c8c01d787d1 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 8 Aug 2024 18:26:46 +0200 Subject: [PATCH] [fix] online_currency.py: if more alternatives, use the last in the list If there are more than one ISO 4217 numeric codes [1] for a currency use the last one in the list of alternatives [2]. [1] https://en.wikipedia.org/wiki/ISO_4217#Active_codes_(list_one) [2] https://en.wikipedia.org/wiki/ISO_4217#Historical_codes Closes: https://github.com/searxng/searxng/issues/3713 Signed-off-by: Markus Heiser --- searx/search/processors/online_currency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/search/processors/online_currency.py b/searx/search/processors/online_currency.py index 7d6811e6b..197e0e061 100644 --- a/searx/search/processors/online_currency.py +++ b/searx/search/processors/online_currency.py @@ -23,7 +23,7 @@ def name_to_iso4217(name): currency = CURRENCIES['names'].get(name, [name]) if isinstance(currency, str): return currency - return currency[0] + return currency[-1] def iso4217_to_name(iso4217, language):