So, I felt like rewriting the WebUI to be valid XHTML valid today, and
came across a problem with which I need some CGI help:
dspam.cgi takes and replaces > characters with > (as well as < with
<, though this doesn't matter.):
1. $from =~ s/</</g;
2. $from =~ s/>/>/g;
3. $subject =~ s/</</g;
4. $subject =~ s/>/>/g;
dspam.cgi then takes and truncates the from and subject lines if they
are longer than MAX_COL_LEN, which is set in configure.pl, and adds ...
to the end:
1. $from = substr($from, 0, ($CONFIG{'MAX_COL_LEN'} + 3)) . "..." if
(length($from)>$CONFIG{'MAX_COL_LEN'});
2. $subject = substr($subject, 0, ($CONFIG{'MAX_COL_LEN'} + 3)) .
"..." if (length($subject)>$CONFIG{'MAX_COL_LEN'});
The problem with this is that > is 3 characters longer than >, which
ends up truncating the wrong part of the lines, resulting in invalid code:
1. <td class="rowEven" nowrap="nowrap"><small>"Dolores"
<[EMAIL PROTECTED]>...</small></td> or
"Dolores" <[EMAIL PROTECTED]>...
instead of
2. <td class="rowEven" nowrap="nowrap"><small>"Dolores"
<[EMAIL PROTECTED]>...</small></td> or
"Dolores" <[EMAIL PROTECTED]>
See what I mean? I might be way off on the cause as to why this
happens, but regardless, it does.
Anyone mind telling me how to fix this? I'll include it in the
valid-xhtml patch that I am trying to put together.
Thanks,
Kyle