#### Brief overview of PR changes/additions
- Reject MSP/GMCP media file names containing `..` that resolve outside
the profile's media directory (relative sub-directories and wildcards
still work).
- Guard `TEntityResolver::resolveCode()` against the empty value from a
malformed numeric entity like `&#;`, which previously called
`QString::front()` on an empty string (undefined behaviour).
- Add a `TEntityResolver` regression test for the malformed-entity case.
#### Motivation for adding to Mudlet
A connected game server could use a crafted MSP `!!SOUND`/`!!MUSIC` or
GMCP `Client.Media` file name to download and write attacker-controlled
content to an arbitrary path (e.g. an autostart entry), or read/play an
arbitrary local file — with no user interaction, since both protocols
are enabled by default.
#### Other info (issues closed, discussion etc)
Security hardening of the server-facing media path. `isFileRelative()`
only rejected absolute paths, so a relative `..` traversal passed
validation before being concatenated onto the media directory.
**Test case:** Connect a profile to a server that sends
`!!SOUND(../../evil.wav U=http://example/evil.wav)` — it is now rejected
with a `WARNING - rejected a media file name that escapes the profile
media directory` log line, while a normal `!!SOUND(hit.wav U=...)` still
downloads and plays.
---
_Generated by [Claude
Code](https://claude.ai/code/session_011XUZefuDuy8F1M4bHq5jMZ)_
---------
Signed-off-by: Vadim Peretokin <vperetokin@hey.com>
Co-authored-by: Claude <noreply@anthropic.com>
<!-- Keep the title short & concise so anyone non-technical can
understand it,
the title appears in PTB changelogs -->
#### Brief overview of PR changes/additions
Mudlet was only able to display entities with only one Latin1 character
in normal mud output.
This fix removes this restriction and also enables the use of special
characters represented by MXP default entities.
#### Motivation for adding to Mudlet
Improve MXP compliance
#### Other info (issues closed, discussion etc)
The patch changes small tidbits in several places: TBuffer was not able
to add additional characters to an input line, also the inserted entity
content must be reparsed to see if an MXP element is contained or to
interprete any non-Latin1 encoding while not risking a deadlock by
trying to resolve a recursive entity definition. This also required a
way for the entity resolver if a given entity is custom, default, or
unknown.
There are some screenshots and remarks at the end of
https://forums.mudlet.org/viewtopic.php?f=7&t=23206&start=10 .
Also, you can see how this works by connection to aldebaran-mud.de login
as a guest char (hit y to confirm) then "set mxp test 5", "set mxp test
6" or, for insights: "set mxp test 5 source", "set mxp test 6 source"
#### Brief overview of PR changes/additions
Update new instances of QStringLiteral to shorter qsl
#### Motivation for adding to Mudlet
Follow-up to https://github.com/Mudlet/Mudlet/pull/5640 for the new instances that have sneaked in with new PRs
#### Other info (issues closed, discussion etc)
Would be nice to have a danger check find these.
Refactoring/reimplementation of MXP protocol
Extracts MXP support from TBuffer
Separates input parsing from protocol processing: input is parsed into MxpTag objects by the MxpNodeBuilder and are passed to be handled by the MxpTagProcessor
Class hierarchy of MxpTagHandler for implementing support for each tag: allows for a clear separation of the implementation of each tag and makes it easier for adding support for new tags
Defines a clear interface (MxpClient) separating the MXP implementation from other parts of the code
Solves some limitations of previous implementation such as supporting element definitions not only for<SEND> tags, interpolating named and positional attributes and interpolating &text; placeholder by tag content
Includes support for COLOR tag
Handles FONT, U, I, B, VAR and !ENTITY tags, but so far no defined behavior (can be implemented in MxpMudlet)
Attributes that hold MXP state are now in the Host class to avoid needless copies when TBuffer is copied around
Introduces QtTests for some of the classes
Other refactorings intended to simplify TBuffer class, extracting responbilities that aren't directly related to the buffer mgmt
Extracted TEncodingTable from TBuffer, this class is responsible for mapping encoding names to tables. It also removes some bloat from TBuffer.
TLinkStore to manage links and associated hints to be displayed.
TEntityResolver to map character entities, such as >     to their associated string values; supports interpolating strings replacing the entity placeholders by their values