Commit graph

2 commits

Author SHA1 Message Date
Vadim Peretokin
045a256158
fix: a profile named "." or ".." deletes every profile when removed (#9722)
#### Brief overview of PR changes/additions
- Validation: a typed profile name must be a folder of its own - rejects
a lone `.` and anything containing `..`. Folders already on disk stay
exempt
- Containment: `reallyDeleteProfile()` refuses any path that is not a
direct child of `profiles/`, and now checks `removeRecursively()`
instead of failing mute
- Confirmation: the "nothing to delete" shortcut no longer fires when a
map, stored password or dictionary is present

#### Motivation for adding to Mudlet
A profile named `.` or `..` turned **Remove** into a wipe: `.` resolves
to `profiles/`, `..` to the whole `~/.config/mudlet`. The name was
accepted with no error, and the confirmation was skipped because a fresh
profile looks empty - two clicks deep on the first screen every user
sees.

#### Other info (issues closed, discussion etc)
Pre-existing, not a 5.0 regression - shipped 4.22.0 behaves identically.
Dots have been allowed deliberately since 2011 (`ee1fd051c`), and
`Achaea 2.0` keeps working.

**Test case:** name a new profile `.` and press Remove - previously
every profile was deleted with no prompt, now the name is refused.

New `ProfileDeletionSafetyTest` drives the real dialog against a
temporary config dir, plus `profileFolderPath`/`profileNameUsableAsIs`
rows in `ProfileNameValidationTest`. 81/81 ctest pass.

Assisted-by: Claude:claude-opus-5
2026-08-08 08:30:14 +02:00
Vadim Peretokin
bb2ead764c
fix: profiles with parentheses in their name can be opened again (#9610)
#### Brief overview of PR changes/additions
- Parentheses are now allowed in profile names, matching the "name (2)"
folders file managers create when copying
- Selecting a profile folder made outside Mudlet no longer silently
mangles its name and renames the folder on disk
- Adds ProfileNameValidationTest for the name validation rules and
ProfileFolderNameTest, which drives the real connection dialog against
externally-created folders (fails without the fix)

#### Motivation for adding to Mudlet
Merely selecting a profile folder like "test (2)" mangled its name to
"test 2" and silently renamed the folder on disk, and the reporter could
not launch the profile at all.

#### Other info (issues closed, discussion etc)
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-opus-5
Signed-off-by: Vadim Peretokin <vadim.peretokin@mudlet.org>

**Test case:** Copy a profile folder to "test (2)" while Mudlet is
closed, reopen - the profile keeps its name, Connect/Offline are
enabled, and it opens.

#### Demo


https://github.com/user-attachments/assets/25b1bb4c-eaa7-4079-8b8e-a12de3ebb215
2026-08-04 16:09:42 +02:00