Skip to content

Commit

Permalink
fix regexp cve (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
keldaan-ag authored Apr 3, 2024
1 parent 509ea41 commit 8906cbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/rooms/commands/lobby-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ export class OpenBoosterCommand extends Command<

function pickRandomPokemonBooster(guarantedUnique: boolean): PkmWithConfig {
let pkm = Pkm.MAGIKARP,
shiny = chance(0.03),
emotion = Emotion.NORMAL
const shiny = chance(0.03)
const rarities = Object.keys(Rarity) as Rarity[]
const seed = Math.random() * sum(Object.values(BoosterRarityProbability))
let threshold = 0
Expand Down
4 changes: 2 additions & 2 deletions app/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export const CDN_PORTRAIT_URL =
export const CDN_URL =
"https://raw.githubusercontent.com/keldaanCommunity/SpriteCollab/master"

export const USERNAME_REGEXP =
/^(?=.{4,20}$)(?:[\u0021-\uFFFF]+(?:(?:\.|-|_)[\u0021-\uFFFF])*)+$/
// eslint-disable-next-line no-useless-escape
export const USERNAME_REGEXP = /^[a-zA-Z0-9\._\-]{2,20}[^.-]$/

export type NonFunctionPropNames<T> = {
// eslint-disable-next-line @typescript-eslint/ban-types
Expand Down

0 comments on commit 8906cbe

Please sign in to comment.