From ea8db29c2bc4d168472671326db66ae77ace667e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 19 May 2012 10:20:03 +0200 Subject: [PATCH] Escape HTML tags in window caption in Aurorae and Killer The unescaped tags are interpreted as HTML by Aurorae decorations and the KWin killer. Escaping the tags ensures that the text is not rendered incorrectly. BUG: 293657 FIXED-IN: 4.9.0 REVIEW: 104989 --- clients/aurorae/src/qml/aurorae.qml | 1 + killer/killer.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/clients/aurorae/src/qml/aurorae.qml b/clients/aurorae/src/qml/aurorae.qml index 98deb9e4ce..25ef2eb1f3 100644 --- a/clients/aurorae/src/qml/aurorae.qml +++ b/clients/aurorae/src/qml/aurorae.qml @@ -151,6 +151,7 @@ Decoration { Text { id: caption text: decoration.caption + textFormat: Text.PlainText horizontalAlignment: auroraeTheme.horizontalAlignment verticalAlignment: auroraeTheme.verticalAlignment elide: Text.ElideRight diff --git a/killer/killer.cpp b/killer/killer.cpp index d37a654404..c88a9244f3 100644 --- a/killer/killer.cpp +++ b/killer/killer.cpp @@ -32,6 +32,8 @@ DEALINGS IN THE SOFTWARE. #include #include #include +// TODO: remove with Qt 5, only for HTML escaping the caption +#include #include #include @@ -66,6 +68,9 @@ int main(int argc, char* argv[]) KCmdLineArgs::usageError(i18n("This helper utility is not supposed to be called directly.")); return 1; } + if (Qt::mightBeRichText(caption)) { + caption = Qt::escape(caption); + } QString question = i18n( "

The window \"%2\" is not responding. " "It belongs to the application %1 (Process ID = %3, hostname = %4).

"