Skip to content

Commit 1f78fe4

Browse files
authored
Merge pull request #2398 from opengovsg/release-1.80
Release 1.80 [to release]
2 parents 4df46a0 + 04305b7 commit 1f78fe4

File tree

6 files changed

+39
-24
lines changed

6 files changed

+39
-24
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [v1.80.0](https://github.com/opengovsg/GoGovSG/compare/v1.79.2...v1.80.0)
8+
9+
- chore: escape raw html [`#2395`](https://github.com/opengovsg/GoGovSG/pull/2395)
10+
- chore: fix compoute issue from tags [`#2396`](https://github.com/opengovsg/GoGovSG/pull/2396)
11+
- Release 1.79.2 `develop` [`#2392`](https://github.com/opengovsg/GoGovSG/pull/2392)
12+
713
#### [v1.79.2](https://github.com/opengovsg/GoGovSG/compare/v1.79.1...v1.79.2)
814

15+
> 9 July 2025
16+
917
- chore: correct capitalization of GoGovSG in README.md [`#2390`](https://github.com/opengovsg/GoGovSG/pull/2390)
1018
- chore: fix codeql [`#2385`](https://github.com/opengovsg/GoGovSG/pull/2385)
1119
- chore: fix formatting [`#2384`](https://github.com/opengovsg/GoGovSG/pull/2384)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "GoGovSG",
3-
"version": "1.79.2",
3+
"version": "1.80.0",
44
"description": "Link shortener for Singapore government.",
55
"main": "src/server/index.js",
66
"scripts": {

src/server/api/user/validators.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,23 @@ export const hasApiKeySchema = Joi.object({
2828
userId: Joi.number().required(),
2929
})
3030

31+
const singleTagSchema = Joi.string()
32+
.pattern(/^[A-Za-z0-9-_]+$/)
33+
.max(25)
34+
3135
const tagSchema = Joi.array()
3236
.max(MAX_NUM_TAGS_PER_LINK)
3337
.optional()
38+
// letters, numbers, hyphens, underscores, 25 digits
3439
.items(
35-
Joi.string().custom((tag: string, helpers) => {
36-
if (!isValidTag(tag)) {
37-
return helpers.message({ custom: `tag: ${tag} format is invalid` })
38-
}
39-
return tag
40-
}),
40+
singleTagSchema
41+
.custom((tag: string, helpers) => {
42+
if (!isValidTag(tag)) {
43+
return helpers.error('tag:invalid')
44+
}
45+
return tag
46+
})
47+
.messages({ 'tag:invalid': 'Tag format is invalid.' }),
4148
)
4249
.unique((a, b) => a === b)
4350

@@ -60,13 +67,13 @@ export const userTagsQueryConditions = Joi.object({
6067
.min(3)
6168
.custom((tag: string, helpers) => {
6269
if (!isValidTag(tag)) {
63-
return helpers.message({
64-
custom: `tag: ${tag} query format is invalid.`,
65-
})
70+
return helpers.error('tag:invalid')
6671
}
6772
return tag
6873
})
74+
.messages({ 'tag:invalid': 'Tag format is invalid.' })
6975
.required(),
76+
7077
limit: Joi.number().required(),
7178
})
7279

src/server/views/404.error.ejs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<meta http-equiv="X-UA-Compatible" content="ie=edge">
77
<meta http-equiv="Content-Language" content="en">
88
<meta charset="UTF-8">
9-
<title><%- displayHostname %>: Page not found</title>
9+
<title><%= displayHostname %>: Page not found</title>
1010
<base href="~/" />
1111
<link href="/assets/styles/shared/shared-styles.css" rel="stylesheet">
12-
<link href="/assets/<%- assetVariant %>/styles/colours.css" rel="stylesheet">
12+
<link href="/assets/<%= assetVariant %>/styles/colours.css" rel="stylesheet">
1313
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;700&display=swap" rel="stylesheet">
1414
<link href="/assets/styles/not-found-page/not-found-page.css" rel="stylesheet">
1515
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
@@ -29,11 +29,11 @@
2929
<div id="divider" class="divider"></div>
3030
<div id="graphics-container">
3131
<div id="graphic-div">
32-
<img src="/assets/<%- assetVariant %>/not-found-page/images/not-found-graphic.svg" draggable="false" />
32+
<img src="/assets/<%= assetVariant %>/not-found-page/images/not-found-graphic.svg" draggable="false" />
3333
</div>
3434
<div id="go-logo-div">
3535
<!-- go logo -->
36-
<img src="/assets/<%- assetVariant %>/not-found-page/icons/go-logo.svg" draggable="false" />
36+
<img src="/assets/<%= assetVariant %>/not-found-page/icons/go-logo.svg" draggable="false" />
3737
</div>
3838
</div>
3939
</main>

src/server/views/transition-page.ejs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<meta http-equiv="X-UA-Compatible" content="ie=edge">
77
<meta http-equiv="Content-Language" content="en">
88
<meta charset="UTF-8">
9-
<title><%- displayHostname %></title>
9+
<title><%= displayHostname %></title>
1010
<link href="/assets/styles/shared/shared-styles.css" rel="stylesheet">
11-
<link href="/assets/<%- assetVariant %>/styles/colours.css" rel="stylesheet">
11+
<link href="/assets/<%= assetVariant %>/styles/colours.css" rel="stylesheet">
1212
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;700&display=swap" rel="stylesheet">
1313
<link href="/assets/styles/transition-page/transition-page.css" rel="stylesheet">
1414
<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png">
@@ -22,23 +22,23 @@
2222
<div class="top-half">
2323
<div class="top-half-content">
2424
<h3>Check your address bar</h3>
25-
<a href="https://go.gov.sg/go-antiphishing" target="_blank" rel="noreferrer noopener">Beware of phishing! <br class="mobile-break">Make sure your link starts with <%- displayHostname.toLowerCase() %></a>
25+
<a href="https://go.gov.sg/go-antiphishing" target="_blank" rel="noreferrer noopener">Beware of phishing! <br class="mobile-break">Make sure your link starts with <%= displayHostname.toLowerCase() %></a>
2626
<p id="url" data-href="<%- escapedLongUrl %>">You will be redirected in <span id="countdown-seconds">6</span> second<span id="s">s</span></p>
27-
<img id="spinner" src="/assets/<%- assetVariant %>/transition-page/images/spinner.gif" alt="loading" />
28-
<div class="browser-image" style="background-image: url('/assets/<%- assetVariant %>/transition-page/images/browser.svg');">
29-
<div class="links links-<%- assetVariant %>" ><%- displayHostname.toLowerCase() %>/</div>
27+
<img id="spinner" src="/assets/<%= assetVariant %>/transition-page/images/spinner.gif" alt="loading" />
28+
<div class="browser-image" style="background-image: url('/assets/<%= assetVariant %>/transition-page/images/browser.svg');">
29+
<div class="links links-<%= assetVariant %>" ><%= displayHostname.toLowerCase() %>/</div>
3030
</div>
3131
</div>
3232
</div>
3333
<div class="bottom-half">
3434

3535
<div id="skip">
3636
<span>I've checked the link. Skip ahead</span>
37-
<img src="/assets/<%- assetVariant %>/transition-page/icons/icon-arrow-right.svg" alt="right arrow" />
37+
<img src="/assets/<%= assetVariant %>/transition-page/icons/icon-arrow-right.svg" alt="right arrow" />
3838
</div>
3939
<div class="footer">
4040
<div id="logo">
41-
<img src="/assets/<%- assetVariant %>/transition-page/icons/ogp-logo.svg" alt="ogp logo" />
41+
<img src="/assets/<%= assetVariant %>/transition-page/icons/ogp-logo.svg" alt="ogp logo" />
4242
</div>
4343
<p>You will only be shown this page the first time you access this short link.</p>
4444
</div>

0 commit comments

Comments
 (0)