spambayes/spambayes ProxyUI.py, 1.45.4.1, 1.45.4.2

"Tony Meyer" <[email protected]>
Newsgroups gmane.mail.spam.spambayes.cvs
Message-ID <[email protected]>
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20151/spambayes

Modified Files:
      Tag: release_1_0-branch
	ProxyUI.py 
Log Message:
Correct the fix for escaping subject lines - the problem was in the clues/tokens table,
 not the review one (and the 'fix' was double-escaping them which is not nice).  Instead
 we need to make sure that we make the URL nicer.

A message with a subject of "&<>" and a body of "<>&" works for me now, so I figure
 this should be fixed.

Index: ProxyUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v
retrieving revision 1.45.4.1
retrieving revision 1.45.4.2
diff -C2 -d -r1.45.4.1 -r1.45.4.2
*** ProxyUI.py	20 Dec 2004 03:45:39 -0000	1.45.4.1
--- ProxyUI.py	28 Jan 2005 01:19:07 -0000	1.45.4.2
***************
*** 329,333 ****
                  else:
                      h = self.html.reviewRow.headerValue.clone()
!                 h.text = cgi.escape(text)
                  row.optionalHeadersValues += h
  
--- 329,333 ----
                  else:
                      h = self.html.reviewRow.headerValue.clone()
!                 h.text = text
                  row.optionalHeadersValues += h
  
***************
*** 343,347 ****
                  del row.received_
  
!             subj = messageInfo.subjectHeader
              row.classify.href="showclues?key=%s&subject=%s" % (key, subj)
              row.tokens.href="showclues?key=%s&subject=%s&tokens=1" % (key, subj)
--- 343,352 ----
                  del row.received_
  
!             # Many characters can't go in the URL or they cause problems
!             # (&, ;, ?, etc).  So we use the hex values for them all.
!             subj_list = []
!             for c in messageInfo.subjectHeader:
!                 subj_list.append("%%%s" % (hex(ord(c))[2:],))
!             subj = "".join(subj_list)
              row.classify.href="showclues?key=%s&subject=%s" % (key, subj)
              row.tokens.href="showclues?key=%s&subject=%s&tokens=1" % (key, subj)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.