dhope Posted September 17, 2011 Share Posted September 17, 2011 Hi, I was hoping someone could help me with HTML Purifier. When I use HTML Purifier in xampp it works perfectly, but when I use the same code on my server it strips everything. Has anyone any ideas why this is? HTML Purifier Code: $config = HTMLPurifier_Config::createDefault(); $config->set('Attr.EnableID', true); $purifier = new HTMLPurifier($config); $def = $config->getHTMLDefinition(true); $def->addAttribute('a', 'target', new HTMLPurifier_AttrDef_Enum( array('_blank','_self','_target','_top') )); $html_sidebar_form = $purifier->purify($_POST['html_sidebar_form']) XAMPP HTML: <div id="sidebar_container"><div id="sidebar_heading"><h2>Contact details</h2></div><div id="sidebar_content"><p><strong>Phone</strong>: 0845 095 1142</p></div></div><div> <div><h2>Free Quotation</h2></div><div> <a href="index.php">hello</a> <p>Name:<br /></p> <p>E-mail Address: <br /></p> <p>Phone Number: <br /></p> <p>Enquiry:<br /></p> </div></div> Server HTML: <div><div><h2>Contact details</h2></div><div><p><strong>Phone</strong>: 0845 095 1142</p></div></div><div> <div><h2>Free Quotation</h2></div><div> <p>Name:<br /></p> <p>E-mail Address: <br /></p> <p>Phone Number: <br /></p> <p>Enquiry:<br /></p> </div></div> Quote Link to comment https://forums.phpfreaks.com/topic/247331-html-purifier/ Share on other sites More sharing options...
dhope Posted September 17, 2011 Author Share Posted September 17, 2011 Fixed - http://www.php.net/manual/en/security.magicquotes.disabling.php Quote Link to comment https://forums.phpfreaks.com/topic/247331-html-purifier/#findComment-1270246 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.