Bug 56942

Summary: cervisiapart: cvs comments containing html tags
Product: [Applications] cervisia Reporter: Pascal Cavy <pascal>
Component: generalAssignee: Bernd Gehrmann <bernd>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandrake RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: html tags beeing erroneously interpreted in the log window below

Description Pascal Cavy 2003-04-07 11:35:36 UTC
Version:            (using KDE KDE 3.1)
Installed from:    Mandrake RPMs

cvs comments containing html tags should not be interpreted in the cvs log window

see the snapshot resulting from the cvs comment :
"use <button><img ...></button> tags instead of <input type='image'> because the input value is not posted with the latter"
Comment 1 Pascal Cavy 2003-04-07 11:36:34 UTC
Created attachment 1317 [details]
html tags beeing erroneously interpreted in the log window below
Comment 2 Christian Loose 2003-04-18 17:07:16 UTC
Subject: kdesdk/cervisia

CVS commit by cloose: 

Fix BR #56942: 
Escape output lines for protocol view, so html tags in 
commit messages aren't interpreted.

CCMAIL: 56942-done@bugs.kde.org


  M +2 -0      ChangeLog   1.70
  M +7 -2      protocolview.cpp   1.17


--- kdesdk/cervisia/ChangeLog  #1.69:1.70
@@ -3,4 +3,6 @@
         * Fix BR 56042: Better default colors for white
           background
+        * Fix BR 56942: Escape output lines for protocol view
+          so html tags in commit messages aren't interpreted
 
 2003-02-28  Christian Loose  <christian.loose@hamburg.de>

--- kdesdk/cervisia/protocolview.cpp  #1.16:1.17
@@ -214,4 +214,8 @@ void ProtocolView::processOutput()
 void ProtocolView::appendLine(const QString &line)
 {
+    // Escape output line, so that html tags in commit
+    // messages aren't interpreted
+    const QString escapedLine = QStyleSheet::escape(line);
+
     QColor color;
     // Colors are the same as in UpdateViewItem::paintCell()
@@ -225,6 +229,7 @@ void ProtocolView::appendLine(const QStr
 
     append(color.isValid()
-           ? QString("<font color=\"%1\">%2</font>").arg(color.name()).arg(line)
-           : QString("%1").arg(line));
+           ? QString("<font color=\"%1\">%2</font>").arg(color.name())
+                                                    .arg(escapedLine)
+           : QString("%1").arg(escapedLine));
 }