summaryrefslogtreecommitdiff
path: root/network/r2e/fix-email-header-injection.patch
diff options
context:
space:
mode:
authorAlexander Verbovetsky <alik@ejik.org>2016-09-28 09:05:21 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-10-01 07:17:17 +0700
commit109b2f018af8e4c87e4c793c7c03dfab919fc450 (patch)
treedcd87de986c44dad4e8fc785a32aceb421bf6296 /network/r2e/fix-email-header-injection.patch
parent3d3965883a3f7087769a8c563f37e3569b0e071f (diff)
downloadslackbuilds-109b2f018af8e4c87e4c793c7c03dfab919fc450.tar.gz
network/r2e: Updated for version 2.71 + new maintainer.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/r2e/fix-email-header-injection.patch')
-rw-r--r--network/r2e/fix-email-header-injection.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/network/r2e/fix-email-header-injection.patch b/network/r2e/fix-email-header-injection.patch
new file mode 100644
index 0000000000..8407d5d0ee
--- /dev/null
+++ b/network/r2e/fix-email-header-injection.patch
@@ -0,0 +1,33 @@
+From: Etienne Millon <etienne.millon@gmail.com>
+Date: Fri, 25 May 2012 18:04:08 +0200
+Subject: Fix email header injection
+
+Bug: http://bugs.python.org/issue5871
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526064
+---
+ rss2email.py | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/rss2email.py b/rss2email.py
+index 69998db..a6c3cbe 100755
+--- a/rss2email.py
++++ b/rss2email.py
+@@ -111,9 +111,16 @@ PROXY=""
+ CHARSET_LIST='US-ASCII', 'ISO-8859-1', 'UTF-8', 'BIG5', 'ISO-2022-JP'
+
+ from email.MIMEText import MIMEText
+-from email.Header import Header
++from email.Header import Header as _Header
+ from email.Utils import parseaddr, formataddr
+-
++
++class Header(_Header):
++ # Work-around for <http://bugs.python.org/issue5871>
++ def append(self, s=None, *args, **kwargs):
++ if s is not None:
++ s = s.replace('\n', ' ').replace('\r', ' ')
++ _Header.append(self, s, *args, **kwargs)
++
+ # Note: You can also override the send function.
+
+ def send(sender, recipient, subject, body, contenttype, extraheaders=None, smtpserver=None):