{"id":7134,"date":"2014-05-25T02:40:14","date_gmt":"2014-05-25T02:40:14","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/25\/php-html-purifier-error-undefined-variable-dirty_html-collection-of-common-programming-errors-2\/"},"modified":"2014-05-25T02:40:14","modified_gmt":"2014-05-25T02:40:14","slug":"php-html-purifier-error-undefined-variable-dirty_html-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/25\/php-html-purifier-error-undefined-variable-dirty_html-collection-of-common-programming-errors-2\/","title":{"rendered":"PHP &amp; HTML Purifier error: Undefined variable: dirty_html-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to install HTML Purifier http:\/\/htmlpurifier.org\/ but I get the following error Undefined variable: dirty_html. I was wondering how can I fix this problem?<\/p>\n<p>Here is the PHP code.<\/p>\n<pre><code> require_once '..\/..\/htmlpurifier\/library\/HTMLPurifier.auto.php';\n\n $config = HTMLPurifier_Config::createDefault();\n $config-&gt;set('Core.Encoding', 'UTF-8'); \/\/ replace with your encoding\n $config-&gt;set('HTML.Doctype', 'XHTML 1.0 Strict'); \/\/ replace with your doctype\n $purifier = new HTMLPurifier($config);\n\n $clean_html = $purifier-&gt;purify($dirty_html);\n<\/code><\/pre>\n<p>Here is my html form.<\/p>\n<pre><code>\n    \n        <\/code><\/pre>\n<ul>\n<li><code>About Me:<\/code><\/li>\n<li><code>My Interests:<\/code><\/li>\n<\/ul>\n<pre>\n    \n\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to install HTML Purifier http:\/\/htmlpurifier.org\/ but I get the following error Undefined variable: dirty_html. I was wondering how can I fix this problem? Here is the PHP code. require_once &#8216;..\/..\/htmlpurifier\/library\/HTMLPurifier.auto.php&#8217;; $config = HTMLPurifier_Config::createDefault(); $config-&gt;set(&#8216;Core.Encoding&#8217;, &#8216;UTF-8&#8217;); \/\/ replace with your encoding $config-&gt;set(&#8216;HTML.Doctype&#8217;, &#8216;XHTML 1.0 Strict&#8217;); \/\/ replace with your doctype $purifier = new HTMLPurifier($config); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7134","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7134"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7134\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}