SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Clean HTML for editing HTML in a text area

    Hi, what is the best way to "sanitize" HTML for editing in a text area, then "unsanitizing" it? I have an HTML page I want to edit in a textarea, and I don't know the safest way to do so.

    Should I use h(), if so, is there an... unh() type method.

  2. #2
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does one need to unsanitize in a text area?

    <textarea><%=h '</textarea>' %></textarea>

    The browser kind of natually unsanitizes it and on the following post you'd have pure html to resanitize.

    Am I missing the point?
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought so. Okay thanks a lot, that was perfect


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •