[rt-users] ExtractCustomFields template and dropping errant HTML tags
Thomas Sibley
trs at bestpractical.com
Mon May 20 21:03:30 EDT 2013
On 05/20/2013 02:53 PM, Lundberg, Emory wrote:
> Some additional information as I'm getting big blobs of text with
> markup in several fields on emails and forms that are submitted to my
> RT-4.0.10:
>
>> 2013-05-20 21:37:32 The RT System itself - FQDN you've completed
>> this form!</h3></td></tr></tbody></table></div><div
>> align="center"> </div></body></html> added
>
> I'm stuck on not being sure about the most appropriate way to
> proceed. I don't know if I should be trying to adjust my CustomField
> template to ignore HTML tags designated with '<', or if I should be
> stripping HTML at the MTA and forcing plain text on everybody.
Perhaps ECFV should preferentially use an alternative text/plain part if
one exists, and only use text/html if necessary.
> I'm not using `Set($PreferRichText, 1);` because I don't know if that
> will even help with body parsing at all.
It doesn't affect this parsing, it only affects display in the ticket
history.
> My Template for that field is written as:
>
>> FQDN|Body|FQDN:*([^<].*+)||
I don't think your regex is matching what you expect.
It says to match the string "FQDN", then zero or more colons ":", then
any single character except "<", then any character zero or more times,
then a syntax error since a quantifier "+" is used without anything to
quantify.
Perhaps you meant:
FQDN:\s*([^<]+)$
which matches "FQDN:", optional whitespace, one or more characters that
aren't "<" to the end of the line.
More information about the rt-users
mailing list