Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate specified timezone against IANA database #8832

Closed
jmooring opened this issue Jul 31, 2021 · 1 comment
Closed

Validate specified timezone against IANA database #8832

jmooring opened this issue Jul 31, 2021 · 1 comment
Milestone

Comments

@jmooring
Copy link
Contributor

@jmooring jmooring commented Jul 31, 2021

Case 1: Site Configuration

If an invalid timeZone is specified in the site configuration, the failure is silent. Example:

timeZone = "America/LosAngeles"   # Should be America/Los_Angeles

Case 2: Time Function

If an invalid timezone is specified as the optional second argument to the time function, the failure is also silent (the build continues without error or warning). However, the error is rendered on the page (easy to miss and then inadvertently deploy). Example:

{{ time "2020-07-31T09:29:26" "America/LosAngeles" }}

This renders:

unknown time zone America/LosAngeles
@bep bep added Enhancement and removed Proposal labels Jul 31, 2021
@bep bep added this to the v0.87 milestone Jul 31, 2021
@bep
Copy link
Member

@bep bep commented Aug 1, 2021

The second case above is #8835 -- I separated that into its own issue, because that is more general and technical. We do return an error on invalid timezone in time.AsTime, but due to some technical mumbo jumbo, that error does not transform into a real error when you use the short form time.

@bep bep removed this from the v0.87 milestone Aug 1, 2021
@bep bep added this to the v0.88 milestone Aug 1, 2021
@bep bep removed this from the v0.88 milestone Aug 1, 2021
@bep bep added this to the v0.87 milestone Aug 1, 2021
bep added a commit to bep/hugo that referenced this issue Aug 1, 2021
@bep bep closed this in 4d221ce Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants