Skip Menu |
 

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 43345
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: mkanat [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.18
Fixed in: (no value)



Subject: CHOMP_ONE doesn't handle CRLF properly
Download (untitled) / with headers
text/plain 999b
Short version: If lines end in \r\n, chomping ends up with lines that look like \r\r\n. Long version: We have PRE_CHOMP set. Normally our templates have just \n for newlines, but sometimes (say, when people download them via CVS on Windows or save them in a silly Windows editor) they have \r\n for newlines. We have a template for generating emails. One part of it (in the headers) looks like this (imagine all these lines end in \r\n): X-Bugzilla-Watch-Reason: [% reasonswatchheader %] [%~ IF Param('useclassification') %] X-Bugzilla-Classification: [% classification %] [% END %] X-Bugzilla-Product: [% product %] If that "IF" is false, then the resuling lines look like this in vim: X-Bugzilla-Watch-Reason: None^M^M X-Bugzilla-Product: WorldControl^M We only noticed this because Email::MIME, when processing this template, thinks that everything up to X-Bugzilla-Watch-Reason is *one header* now. Anyhow, I think it's a bug in chomping--lines should definitely never end up with \r\r\n.
Download (untitled) / with headers
text/plain 255b
On Mon Feb 16 21:49:14 2009, MKANAT wrote: Show quoted text
> [%~ IF Param('useclassification') %]
Oh, that should not have the ~ on it, just ignore that (I accidentally copied in some testing code instead of the actual code we have). At the most it should just have -.
Download (untitled) / with headers
text/plain 117b
Problem fixed, tested and committed. http://template-toolkit.org/svnweb/Template2/revision/?rev=1229 Many thanks. A


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.