#766 Long HTML messages may result in unformatted log entries

Current_GIT
closed
nobody
None
5
2012-12-25
2011-03-02
Natenom
No

Sometimes when a user pastes code from a browser the message in mumble is not rendered correctly.
For example if you write this message (in source view):

<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>TESSSSSSSST

Everyone will see this message:

[15:50] To <a href='channelid://791/Gy1XoABcxm+6qC6Kqn5c+F5egnU=' class='log-channel'>Bundestag</a>: <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>TESSSSSSSST

If you remove 8 of the
tags only the sender will see the source code.

It works also in the chatbar when you use SHIFT+Enter instead of
.

Discussion

  • Kissaki

    Kissaki - 2012-12-02

    For me, removing one br from

    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>TESSSSSSSST

    in src, is not sufficient.

    I’m on windows 7, 1.2.4-beta1-12. Natenom on Linux.

    I guess Qt fails to close the tags when we exceed some length / number of tags.
    Or we cut the text off after some length.

     
  • Kissaki

    Kissaki - 2012-12-02

    Murmur.ini:

    #textmessagelength=5000

    I checked the murmur code. No stripping problem there.
    So I guess it has to be on the receiving end.

     
    Last edit: Kissaki 2012-12-02
  • Kissaki

    Kissaki - 2012-12-02

    I checked the murmur code. No stripping problem there.

     
  • Kissaki

    Kissaki - 2012-12-02

    I found what causes this issue.

    The problem occurs client side, when the message is already received (locally or from the server) and validated and prepared for output.
    Log::log calls Log::validHtml,
    which receives the prepared log text html (prefixed with the senders name, wrapped in HTML (clickable user-name)).
    It first tries to use it as HTML.

    This is checked in its size against QDesktopWidget::availableGeometry(QDesktopWidget::screenNumber(MainWindow))
    (ref: size and check)

    If too big, it is checked again, but this time as plaintext.

    If too large as plaintext as well, a log message is logged: [[ Text object too large to display ]]

    If it is small enough now, it is logged as plaintext, resulting in our prepared html text to display.

    For the issue reported here, certainly, we would prefer the error being logged instead of printing plaintext. The problem is we can no longer plaintext the textmessage text without plaintexting the log-style-wrapping - as the knowledge of that was abstracted away through method calls.

    validHTMLis used by Log::log() as well as UserModel::otherRoles.

     
  • Kissaki

    Kissaki - 2012-12-02

    I guess the method(s) should be extended to allow it to only use html, or to rewrite it to plain.

     
  • Kissaki

    Kissaki - 2012-12-09
    • summary: HTML messages are not rendered correctly sometimes --> Long HTML messages may result in unformatted log entries
    • status: open --> accepted
    • milestone: 1.2.2 --> Current_GIT
    • priority: 5 --> 5
     
  • Benjamin Jemlich

    • labels: Mumble -->
    • status: accepted --> closed
    • priority: 5 --> 5