pokerogue/src/ui
Matilde Simões a1a6b0dd5a
[Bug] Nicknames not properly sanitized (#5537)
* Fix #5082: Nicknames not properly sanitized
When a player changes the name of the pokemon
to one that uses one of the following combination
of letters: "@c{}", "@s{}", "@d{}", "@f{}" and "$"
the game shows the name of the pokemon incorrectly in a battle.
Changes made:
- on message-ui-handler.ts file I updated the "showTextInternal"
function to get the original name of the pokemon
or pokemons (in case it's a double battle) saving it in a list
named "pokename" and change it in the text for their
correspondent placeholder which is saved in the list "repname"
(e.g "#POKEMON1" for the first pokemon and "#POKEMON2" for the
second pokemon). After the text is properly modified because
of the special characters ("@c{}", "@s{}", "@d{}", "@f{}")
the name of the pokemons is replaced to it's original value.
- on message-phase.ts file I updated the "start" function to use a
similar approach but only change the pokemon name to it's original
form after the "pageIndex" (which checks the index of the "$")
is updated, so the text is cut properly.
- on ui.ts file I updated the "showtext" function to use same
approach of the previous files, ensuring that the pokemon names
were only replaced back to their original values after all text
processing on "$" was completed.

* Replace `let` with `const`

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-03-19 22:01:33 +00:00
..
settings [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
ability-bar.ts [Refactor] Align ability display with mainline (#5267) 2025-03-16 02:51:02 +00:00
abstact-option-select-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
achv-bar.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
achvs-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
admin-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
arena-flyout.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
autocomplete-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
awaitable-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
ball-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
base-stats-overlay.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
battle-flyout.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
battle-info.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
battle-message-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
bgm-bar.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
candy-bar.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
challenges-select-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
char-sprite.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
command-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
confirm-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
daily-run-scoreboard.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
dropdown.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
egg-counter-container.ts [Refactor] Create global scene variable (#4766) 2025-01-12 15:33:05 -08:00
egg-gacha-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
egg-hatch-scene-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
egg-list-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
egg-summary-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
evolution-scene-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
fight-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
filter-bar.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
filter-text.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
form-modal-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
game-stats-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
hatched-pokemon-container.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
loading-modal-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
login-form-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
menu-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
message-ui-handler.ts [Bug] Nicknames not properly sanitized (#5537) 2025-03-19 22:01:33 +00:00
modal-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
modifier-select-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
move-info-overlay.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
mystery-encounter-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
party-exp-bar.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
party-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokeball-tray.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokedex-info-overlay.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokedex-mon-container.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokedex-page-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokedex-scan-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokedex-ui-handler.ts [UI/UX] [Bug] Icons for egg moves and passives show up even when not unlocked (#5540) 2025-03-19 03:22:52 +00:00
pokemon-hatch-info-container.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokemon-icon-anim-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
pokemon-info-container.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
registration-form-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
rename-form-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
run-history-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
run-info-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
save-slot-select-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
saving-icon-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
scroll-bar.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
scrollable-grid-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
session-reload-modal-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
starter-container.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
starter-select-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
stats-container.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
summary-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
target-select-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
test-dialogue-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
text.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
time-of-day-widget.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
title-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
ui-theme.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00
ui.ts [Bug] Nicknames not properly sanitized (#5537) 2025-03-19 22:01:33 +00:00
unavailable-modal-ui-handler.ts [Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495) 2025-03-09 14:13:25 -07:00