Take the 2-minute tour ×
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It's 100% free, no registration required.

I have a custom profile textarea, formatting set to none, with simple HTML markup in it. According to the EE docs, it should be left "as is." But when I view a template pulling this field into it, all markup is stripped out.

I've been dev'ing in EE for years, and I'm pretty familiar with most things, yet this has never happened to me (nor have I ever had the opportunity for it to be an issue--rarely mess with member profiles).

Originally, I'd assumed the default member bio field's formatting was set to "none," but I was experiencing the same issue, so I made a custom bio field. Same thing happens.

There's nothing surrounding the field in the template, it is literally dropped into a div by itself. There's nothing special about the {exp:member:custom} tag pair either, the only parameter I include is the member_id. All other fields display properly (screen_name, and a series of links to social profiles).

share|improve this question
add comment

1 Answer 1

UPDATED: You should probably set your custom field to be formatted as "XHTML." Custom member fields are processed by the Typography class, which strips HTML tags when "none" is used (as a security precaution).

Since you have written your own custom field, you can verify my statement by reviewing these functions in the Custom Member Field call chain:

  • mod.member.php::custom_profile_data()
  • EE_Typography.php::parse_type()
  • EE_Typography.php::format_html()

UPDATE: Since XHTML does not appear to work around this for all HTML tags, the following core hack will work for now:

  1. Open system/expressionengine/libraries/EE_Typography.php
  2. Find function parse_type
  3. Locate $str = $this->format_html($str); within the function.
  4. Replace that line with this: if ($this->text_format != 'none') { $str = $this->format_html($str); }
share|improve this answer
    
That was my first thought, actually. However, it also strips out the HTML I've placed in it and places all of the text in a single <p> tag. The reason I went with no formatting is, specifically, the docs say "None...might be useful if you want people to be able to use full HTML in this field." link I feel like this might be better suited for EllisLab's own forum, since it seems to be either a bug or an error in the docs. –  Vince Falconi Dec 26 '12 at 21:08
    
EllisLab staff isn't answering on the forum anymore unfortunately. If you think it's a bug, your best bet is to post to the bug tracker: support.ellislab.com/bugs. –  Anna_MediaGirl Dec 26 '12 at 22:58
    
Thanks, Anna! Realized that when I went over there. Think I'm going to get a support subscription anyhow (completely unrelated to the intimidating language on the bug tracker haha). –  Vince Falconi Dec 27 '12 at 15:05
1  
It may take a while to get a solution for your bug report. In the mean time, I have updated my solution. Use it with caution since the modification can open your site to several security holes via user-created javascript. –  Peg Leg 3941 Dec 28 '12 at 17:24
    
Thanks for that workaround! I'll keep it in the hopper while we finish building everything out. –  Vince Falconi Dec 28 '12 at 19:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.