Closed TheTinkeringIdiot closed 3 weeks ago
@TheTinkeringIdiot - Is there a specific set of allowed characters for Pets? A regex would be nice if you have some thoughts.
As I recall (and a quick search to confirm), the colorful pet names we all love are accomplished by starting the name with a 0x10 character, then a single character in the range 0x01-0x7F, followed by the printable name. So something like:
(\x10[\x01-\x7f])?[\w\s]{1,}
Should allow colorful names containing alphanumeric and space characters without allowing the more potentially problematic punctuation. Of course other characters deemed safe can be added easily enough. I can get on live this evening and spend a little time sussing out what the limits are there.
The slash command as a pet name didn't immediately present a problem during my testing, but not knowing how that string gets passed around I thought I'd report it - AO has a long and storied history of failure to validate inputs before using them.
The live servers allow the slash in the pet name as well, and similarly the nameplate changes the / to an X. However, the X also appears in the chat, not just the nameplate. So it seems they're just filtering out potentially nasty characters and replacing them, rather than restricting to safe character classes. / becomes X, & becomes '& amp;' (without the space), and @ appears to get dropped, but a single pixel does display that isn't present in names without the @ so I think it's being replaced as well.
Confirmed fixed.
Pet renaming appears to now follow the same conventions as the live game. Closing as complete.
Describe the bug Pets can be named for slash commands.
To Reproduce Steps to reproduce the behavior:
Expected behavior Slash character should not be allowed in pet names
Screenshots![image](https://github.com/project-rubika/issues/assets/96996793/dba7df49-c8ee-4cb0-834d-7411f9136a87)
Character info: (for the pet)
Playfield info: