Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6057269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:28:11+00:00 2026-05-23T08:28:11+00:00

I want to allow my users to input HTML. Requirements Allow a specific set

  • 0

I want to allow my users to input HTML.

Requirements

  1. Allow a specific set of HTML tags.
  2. Preserve characters (do not encode ã into ã, for example)

Existing options

  1. AntiSamy. Unfortunately AntiSamy encodes special characters and breaks requirement 2.
  2. Native ColdFusion functions (HTMLCodeFormat() etc…) don’t work as they encode HTML into entities, and thus fail requirement 1.
  3. I found this set of functions somewhere, but I have no way of telling how secure this is: http://pastie.org/2072867

So what are my options? Are there existing libraries for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:28:11+00:00Added an answer on May 23, 2026 at 8:28 am

    Portcullis works well for Cold Fusion for attack-specific issues. I’ve used a couple of other regex solutions I found on the web over time that have worked well, though they haven’t been nearly as fleshed out. In 15 years (10 as a CMS developer) nothing I’ve built has been hacked….knock on wood.

    When developing input fields of any type, it’s good to look at the problem from different angles. You’ve got the UI side, which includes both usability and client-side validation. Yes, it can be bypassed, but javascript-based validation is quicker, more responsive, and rates higher on the magical UI scale than backend-interruption method or simply making things “disappear” without warning. It will speed up the back-end validation because it does the initial screening. So, it’s not an “instead of” but an “in-addition to” type solution that can’t be ignored.

    Also on the UI front, giving your users a good quality editor also can make a huge difference in the process. My personal favorite is CKeditor simply because it’s the only one that can handle Microsoft Word code on the front-side, keeping it far away from my DB. It seems silly, but Word HTML is valid, so it won’t setoff any red flags….but on a moderately sized document it will quickly overload a DB field insert max, believe it or not. Not only will a good editor reduce the amount of silly HTML that comes in, but it will also just make things faster for the user….win/win.

    I personally encode and decode my characters…it’s always just worked well so I’ve never changed practice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to allow users to paste <embed> and <object> HTML fragments (video players)
I have a system which allows users to enter HTML-reserved characters into a text
I want to allow users to upload avatar-type images in a variety of formats
We have a high security application and we want to allow users to enter
I'm building a CMS in ASP.NET MVC and want to allow users to pick
I have a REST data service where I want to allow the users to
My web-app records users via webcam and microphone. I want to use HTML/JS for
I have an HTML text input where users can write in a name for
I have an input running in an HTML page. I'm using jQuery UI.I want
I need to allow users to submit a form value containing html in their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.