Package: reportbug
Version: 3.39
Severity: normal
Tags: patch

--- Please enter the report below this line. ---
reportbug-ng needs to escape quotes in arguments passed to MUAs which use 
quotes (e.g. KMail).

The attached patch fixes this.

Thank you.


-- 
http://daniel.hahler.de/
diff -ru reportbug-ng-0.2007.10.30.orig/src/lib/ReportbugNG.py reportbug-ng-0.2007.10.30/src/lib/ReportbugNG.py
--- reportbug-ng-0.2007.10.30.orig/src/lib/ReportbugNG.py	2007-10-30 20:15:16.000000000 +0100
+++ reportbug-ng-0.2007.10.30/src/lib/ReportbugNG.py	2007-12-20 03:56:22.061059054 +0100
@@ -66,7 +66,12 @@
         to = to.encode("ascii", "replace")
         subject = subject.encode("ascii", "replace")
         body = body.encode("ascii", "replace")
-    
+
+    # If quotes are used for this MUA, escape the quotes in the arguments:
+    if '"' in MUA_SYNTAX[mua] and MUA_SYNTAX[mua].count('"')%2 == 0:
+        to = to.replace('"', '\\"')
+        subject = subject.replace('"', '\\"')
+        body = body.replace('"', '\\"')
     
     command = MUA_SYNTAX[mua] % {"to":to, "subject":subject, "body":body}
     

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to