Skip to content

Commit

Permalink
Fix code scanning (#46)
Browse files Browse the repository at this point in the history
* Fix `DOM text reinterpreted as HTML` https://github.com/daohoangson/dvhcvn/security/code-scanning/1
* Fix `Incomplete string escaping or encoding` https://github.com/daohoangson/dvhcvn/security/code-scanning/2
  • Loading branch information
daohoangson authored Aug 28, 2023
1 parent 281da12 commit ebf479a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions demo/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@
});
});
};
select2.onchange = _ =>
(window.location =
`/demo/map.html` +
`?level1_id=${select1.value}` +
`&level2_id=${select2.value}`);
select2.onchange = _ => {
const level1Id = `${select1.value}`.replace(/[^0-9]/g, '')
const level2Id = `${select2.value}`.replace(/[^0-9]/g, '')
window.location = `/demo/map.html?level1_id=${level1Id}&level2_id=${level2Id}`;
};

updateSelect2(initialLevel2Id);
};
Expand Down
2 changes: 1 addition & 1 deletion transformers/js-dvhcvn/bin/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function main (args: string[]): void {
function _getString (str: string): string {
if (!str.includes("'")) return `'${str}'`
if (!str.includes('"')) return `"${str}"`
return "'" + str.replace("'", "\\'") + "'"
return "'" + str.replaceAll("'", "\\'") + "'"
}

function _getType (str: string): string {
Expand Down
2 changes: 1 addition & 1 deletion transformers/js-dvhcvn/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es5",
"target": "ES2021",
"module": "commonjs",
"declaration": true,
"outDir": "./lib",
Expand Down

1 comment on commit ebf479a

@vercel
Copy link

@vercel vercel bot commented on ebf479a Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dvhcvn – ./

dvhcvn.vercel.app
dvhcvn-daohoangson.vercel.app
dvhcvn-git-master-daohoangson.vercel.app

Please sign in to comment.