2 messages in net.sourceforge.lists.courier-sqwebmail[sqwebmail] small fix for html.c
FromSent OnAttachments
Hleil LiuJan 13, 2006 10:07 am 
Sam VarshavchikJan 13, 2006 3:14 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[sqwebmail] small fix for html.cActions...
From:Hleil Liu (hlei@gmail.com)
Date:Jan 13, 2006 10:07:37 am
List:net.sourceforge.lists.courier-sqwebmail

hello Sam,

Seems there is a bug in function htmlfilter,when an html email contents an ugly javascript which use ">" as it's operator and not use any comments, the old function can't drop <SCRIPT>、 </SCRIPT> correctly.Please see these two example:

1:can drop correctly

<script language="JavaScript"> <!-- function a(){ if (c > b).... } --> </script>

2:can not drop correctly

<script language="JavaScript"> function a(){ if (c > b).... } </script>

I fix it,it works for me,hope helpful.

--- html.c.orig 2006-01-14 00:47:15.000000000 +0800 +++ html.c 2006-01-14 01:00:21.000000000 +0800 @@ -377,7 +377,7 @@ { switch (cur_state) { case intext: - if (p[l] == '>') + if ((p[l] == '>') && (inscripttag == '0')) { (*htmlfiltered_func)(p+start, l-start); (*htmlfiltered_func)("&nbsp;", 6); @@ -722,6 +722,9 @@ tagattr[nsrc].tagvaluelen); r[tagattr[nsrc].tagvaluelen]=0; q=rfc2045_append_url(contentbase, r);

Regard!