1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-08 10:39:59 +02:00

Potential fix for code scanning alert no. 17: Overly permissive regular expression range

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: mr. m  <91018726+mauro-balades@users.noreply.github.com>
This commit is contained in:
mr. m 2025-05-14 10:16:59 +02:00 committed by GitHub
parent 252af87d9b
commit 0310e89c39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -275,7 +275,7 @@ var gZenMarketplaceManager = {
const themeList = document.createElement('div');
for (const theme of Object.values(themes).sort((a, b) => a.name.localeCompare(b.name))) {
const sanitizedName = `theme-${theme.name?.replaceAll(/\s/g, '-')?.replaceAll(/[^A-z_-]+/g, '')}`;
const sanitizedName = `theme-${theme.name?.replaceAll(/\s/g, '-')?.replaceAll(/[^A-Za-z_-]+/g, '')}`;
const isThemeEnabled = theme.enabled === undefined || theme.enabled;
const fragment = window.MozXULElement.parseXULToFragment(`
<vbox class="zenThemeMarketplaceItem">