Results 1 to 5 of 5

Thread: htmlspecialchars function

  1. #1
    Join Date
    Oct 2008
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default htmlspecialchars function

    Hi folks,

    To keep my tinymce texteditor working using html codes, I removed this function from my posting form. Is there any security issue may occur??? and how to fix this.

    Thx in advance

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Allowing people to post html to your site is always a security issue. It's not a good idea to allow anyone to add their own code and just "trust" that no one will abuse the feature.

  3. #3
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    You can allow certain tags, and I'm sure open-source code is available for this. Usually the allowed set is <i> <u> <b> <a> and maybe a few others. Alternatively, several formatting languages are available, at least for blogs.

    But why exactly do you need HTML to be modifiable by users? Is it something more complicated than formatting?
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  4. #4
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'd like to suggest the all powerful BB CODE!

    You should try googling a PHP BB Code script
    Last edited by thetestingsite; 07-11-2009 at 02:28 AM.

  5. #5
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    As Jesdisciple implied, it all depends on what, exactly, he wants to be able to do. If he actually needs more than formatting, hyperlinks, etc., BB code wouldn't solve the problem. I suspect that may be the case, as tinymce is capable of many (if not more) of the things bb code is.

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
  •