plainblack.com
Username Password
search
Bookmark and Share
View All Tickets
DataForm TextArea fields generate entity encoded HTML  (#12462)
Issue


When used for example as a "contact us" form and given a TextArea field, the TextArea uses a rich text editor that generates HTML.  That HTML then gets entity encoded before being inserted into the mail (email or wG mail), making it look like the attached image, with ulgy "<br />"s appearing in it.

Wobject/DataForm.pm calls $form->getValueAsHtml in getRecordTemplateVars().  Form/Textarea.pm's getValueAsHtml() calls WebGUI::HTML::format($value, 'text').  That entity encodes it.  This makes "getValueAsHtml()" a misleading method name.  That should be called "getEntityEncodedHtml()" or something if it is going to do that.

This should probably use WebGUI::HTML::filter instead in this.

Is there a reason that this works how it currently does?

I could try to fix it (pretty slammed right now; and no, I'm not dead, just trying to bank time/money with another hell project so I can get back to writing code that's broadly useful to people) but I don't have a running wG7 environment, so I'd have to set that up first before I could test a fix.

This is the result of investigating sysred's report from http://www.webgui.org/etcetera/html-tag-in-mails.  I reproduced it on a wG demo instance.

Thanks.

Comments
daviddelikat
0
8/14/2017 10:57 am
sigh, long story short...  the 'default email' template for data forms escapes the html to cause this issue.
anyone should be able to find the code where this occurs by appending this path '/default_email?func=edit' to a webgui host where they have sufficient access.   the text 'ESCAPE=HTML' ( in two separate places ) is the culprit.
most likely the correct solution is to create a different template if you don't want it to do that.
Details
Ticket Status Feedback Requested  
Rating0.0 
Submitted Byscottwalters 
Date Submitted2016-04-01 
Assigned To unassigned  
Date Assigned2023-04-01 
Assigned By 
Severity Cosmetic (misspelling, formatting problems)  
What's the bug in? WebGUI Stable  
WebGUI / WRE Version 7.10.30  
URLuse/bugs/tracker/12462
Keywords
Related Files
Ticket History
8/25/2017
3:31 PM
Feedback Requested daviddelikat
4/1/2016
11:27 PM
Ticket edited scottwalters
4/1/2016
9:57 PM
Ticket created scottwalters
© 2023 Plain Black Corporation | All Rights Reserved