Skip to content

Commit 3a94dc9

Browse files
triskfabaff
authored andcommitted
Escape special characters in credits (home-assistant#5064)
1 parent e2b5ee1 commit 3a94dc9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

credits_generator/update_credits.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ github.repos.getForOrg({
5858
cb(err);
5959
return;
6060
}
61-
if(userInfo.login == 'RubenKelevra') userInfo.name = 'RubenKelevra'; // ugh, because his name is `@RubenKelevra`
61+
if (userInfo.name) {
62+
userInfo.name = userInfo.name.replace(/^@/, '')
63+
.replace(/</g, '&lt;')
64+
.replace(/>/g, '&gt;')
65+
.replace(/[\\`*_{}[\]()#+-.!~|]/g, '\\$&');
66+
}
6267
usersMap[login].info.name = userInfo.name || userInfo.login;
6368
usersMap[login].info.username = userInfo.login;
6469
cb();

0 commit comments

Comments
 (0)