I was playin around with RC4 and tried to put countries in the time zone field. I tried "GB, USA" and "GB USA" (No quotes). It gave me errors and a token verification failure. Please see screenshot.
I can confirm this, on a fresh install of SMF RC4, the error appears when visiting the profile and 'Features and Options > General'
This is being tracked at https://github.com/SimpleMachines/SMF2.1/issues/6844.
The problem is that "USA" is not a valid two character ISO country code, and SMF currently doesn't check whether the country codes supplied by the admin are valid before it tries to feed them to the timezone_identifiers_list() function. This will be addressed by adding some validation checks on the country codes.
In the meantime, you can avoid this on your forum by using valid two character ISO country codes. The help text for the "Show time zones from these countries first" setting includes a link that will help you look up the correct country codes for the countries you are interested in.
A fix has been submitted in https://github.com/SimpleMachines/SMF2.1/pull/6845.
Thanks @Sesquipedalian (https://tinypix.top/images/2021/07/14/i89fN.gif)
No problem. :)
Glad to hear it's bein looked at.
Shouldn't the error details be left-aligned?
I know there is a fix being implemented on GH for this but I think it is still bugged. This is a partial quote from one of my members:
Quoteyou can't take the first 2 letters of a 3 letter code. Some countries 2 and 3 letter codes change.
E.G Bangladesh's 2 letter is BD its 3 letter is BGD if you substitute BGD to BG that is Bulgaria.
Is this not going to cause a few bugs ??? He also suggests maybe trying to match up the first and third letter in a three letter country code as that may be more successful. I posted this on GH as well but though I might as well add it here to. I guess I should add that this is using the new code for the fix on GH.
Every country has a 2 letter code.
The member on your site misunderstands the purpose of that part of the code, Bigguy. It is not meant to correct three-character codes to two-character codes. It is just removing white space and any extra characters that might have snuck into the input for whatever reason.
If the admin enters "Purple monkeys", it will be truncated and capitalized to "PU". If the admin enters "Viet Nam", it will be truncated and capitalized to "VI". If the admin enters "USA", it will be truncated and capitalized to "US". If the admin enters "BGD", it will be truncated and capitalized to "BG".
Generally speaking, if the truncation happens to produce a valid but unexpected result, it will be the responsibility of the admin to find and enter the correct two-character code for the intended country.
EDIT: ...Actually, now that I think about it, it's probably cleaner to just fail immediately on overlong strings, rather than truncating them. If the admin accidentally enters an extra character, we'll just reject the whole string.
That's fine. I just thought I would bring it up as after your code from GH was applied to a RC4 install it got the two mixed up and we thought it was an error. Thanks for explaining and if something good came out of this, well all the better. :)