Welcome! » Log In » Create A New Profile

Cannot figure out how to install

Posted by Square1 
Cannot figure out how to install
February 01, 2012 09:02PM

I feel like I am the dimmest bulb in the box! I cannot follow the install directions.

1. I am using PHP 5.3.8

2. I downloaded the zip for the Standalone option and unzipped

3. I created a directory called "library" at /home/mysite/library

4. Inside the library folder I placed the "standalone" folder and the "HTMLPurifier.standalone.php" file

That is all I did on the server install

On my test page I added the following:

1. require('/home/mysite/library/HTMLPurifier.standalone.php'); below the body tag

2. Below that I added the following

$config = HTMLPurifier_Config::createDefault();

$purifier = new HTMLPurifier($config);

$clean_html = $purifier->purify($dirty_html);

3. After my test code I added < script >alert('XSS!');< /script >

That is all I did. I have a gut feeling I am way off....

Any help appreciated!

Re: Cannot figure out how to install
February 02, 2012 07:54AM

You've left out the most crucial component of a bug report: what did you expect to happen, and what actually happened? You should also post your PHP code.

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with &lt; and &gt;.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: