Review Request 121296: Escape ampersands in notifications
Kai Uwe Broulik
kde at privat.broulik.de
Sun Nov 30 20:33:23 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121296/
-----------------------------------------------------------
(Updated Nov. 30, 2014, 8:33 p.m.)
Status
------
This change has been marked as submitted.
Review request for Plasma and Martin Klapetek.
Bugs: 341029
https://bugs.kde.org/show_bug.cgi?id=341029
Repository: plasma-workspace
Description
-------
Since notifications now enforce StyledText and due to how QtQuick Text (or QTextDocument for that matter) treat HTML entities, it cuts off text whenever there's a alone & somewhere.
This fancy regexp from [1] keeps " & < > and ' while replacing any other with &. This makes the StyledText enforcement safe for 5.1 imho.
(My impression is that an & triggeres the "look for the semicolon that terminates this entity" which it won't find and then just cut off the text, see QTBUG-33368, in contrast to every webbrowser that just prints these verbatim)
[1] https://stackoverflow.com/questions/16423089/regex-match-ampersand-but-not-escaped-xml-characters
Diffs
-----
dataengines/notifications/notificationsengine.cpp 8bc50e7
Diff: https://git.reviewboard.kde.org/r/121296/diff/
Testing
-------
Deleting "Battery & Brightness" undo notification works as expected and kdialog --passivepopup "test & test & test "test"" works as expected
Thanks,
Kai Uwe Broulik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20141130/16633fa5/attachment-0001.html>
More information about the Plasma-devel
mailing list