+{maketoc} |
!About
|
This filter uses Open Source Software [http://htmlpurifier.org/|HTMLPurifier] to cleanup the HTML submitted to your site and ensure that it is standards compliant and does not contain anything malicious. It is also used to ensure that the various places that input is split for previews does not cause bad markup to break the page. This filter is highly recommended if you are allowing HTML but is still good for sites that are not using thse formats for the ability to cleanup markup which has been split for preview properly though this may disable certain plugins that insert non standards compliant code. See also ((HTMLPurifier Filter Options)).
|
|
!Installation
|
-You can either install HTMLPurifier using PEAR or you can download the library from the htmlpurifier site and unpack it somewhere on your server. Either way you must make sure that the library is in your include_path. Normally PEAR modifies your php.ini to include all of the PEAR installed libraries when you install PEAR so if you install the library that way you don't have to do anything extra. If you are not using pear you either need to modify your php.ini yourself or modify the include_path directive using kernel/config_inc.php and ini_set (assuming your php.ini allows that.)
|
-
|
-!!Editing php.ini
|
-Edit your php.ini file (often /etc/php.ini but location will vary based on your server). Inside that file is a directive section for "Paths and Directories." By default include_path is set to ".:/usr/local/lib/php". Modify that line to include the path to where you installed HTMLPurifier
|
+You can either |
+* __Install HTML Purifier using PEAR__. Normally, PEAR modifies your php.ini to include all libraries installed with PEAR. If you install HTML Purifier via PEAR you don't have to do anything extra.{code source="bash"}pear channel-discover htmlpurifier.org; |
+pear install hp/HTMLPurifier;{/code} |
+* Or __download HTML Purifier from [http://htmlpurifier.org/|htmlpurifier.org]__ and unpack it somewhere on your server. You must then make sure that the library is in your ''include_path''. Two methods are described below. In short, you can either |
+** __modify your server's php.ini__, |
+** or __modify your bitweaver's config_inc.php__, assuming your php.ini allows using ''ini_set''. |
|
+! Including the library |
+!!Modifying php.ini |
+One option is to edit your php.ini file (often /etc/php.ini but location will vary based on your server). Inside that file is a directive section for ''Paths and Directories''. By default include_path is set to ".:/usr/local/lib/php". Modify that line to include the path to where you installed HTML Purifier |
+{code title="php.ini"} |
include_path = .:/usr/local/lib/php:/path/to/HTMLPurifier
|
+// the above must be entered all on one line, with no linebreaks. |
+{/code} |
|
-The above must be entered all on one line, with no linebreaks.
|
-
|
-!!Using ini_set
|
-The other option is to add an [http://www.php.net/manual/en/function.ini-set.php|ini_set] to your kernel/config_inc.php to modify this path at runtime like so:
|
+!!Modifying config_inc.php |
+__The other option__ is to add an [http://www.php.net/manual/en/function.ini-set.php|ini_set] to your kernel/config_inc.php to modify this path at runtime: |
|
+{code title="kernel/config_inc.php"} |
ini_set("include_path", ini_get("include_path").":/path/to/HTMLPurifier");
|
+{/code} |
|
-This may or may not work depending on the configurations in your php.ini. See [http://www.php.net/manual/zh/ini.php|ini.php] for more information. |
+! More Info |
+This may or may not work depending on the configurations in your php.ini. See [http://www.php.net/manual/zh/ini.php|ini.php] for more information. |