Remove exception, as we check for it later
[htmlpurifier-web.git] / download.xhtml
blob5254a8e1801744ec6d868b1b478bac85de893545
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
4 <!ENTITY % htmlpurifier.current SYSTEM "current.ent"> %htmlpurifier.current;
5 ]>
6 <html
7 xmlns="http://www.w3.org/1999/xhtml"
8 xmlns:xi="http://www.w3.org/2001/XInclude"
9 xml:lang="en">
10 <head>
11 <title>Download - HTML Purifier</title>
12 <xi:include href="common-meta.xml" xpointer="xpointer(/*/node())" />
13 <meta name="description" content="Download HTML Purifier, the standards-compliant HTML filter library." />
14 <meta name="keywords" content="HTMLPurifier, HTML Purifier, HTML, filter, filtering, standards, compliant, w3c, download, zip, tarball, tgz, sig, gpg, gnupg, sha1, hash, checksum" />
15 </head>
16 <body>
18 <xi:include href="common-header.xml" xpointer="xpointer(/*/node())" />
19 <h1 id="title">Download</h1>
21 <div id="content">
23 <p>
24 The current version of HTML Purifier is
25 <strong>&htmlpurifier.current.version;</strong>, released on
26 &htmlpurifier.current.release-date;, and is compatible with
27 <abbr>PHP</abbr> 5.0.5 and up (all code is <code>E_STRICT</code>
28 compliant). This library is open-source,
29 licensed under the <a href="http://www.gnu.org/licenses/lgpl.html"><abbr>LGPL</abbr>
30 v2.1+</a>. We offer multiple ways of downloading
31 and installing HTML Purifier.
32 </p>
34 <div id="toc" class="floated" />
36 <!--
37 <h2 id="Errata">Errata</h2>
39 <p>
40 Here is a list of known bugs. These issues have all been fixed in the
41 <a href="#NightlyBuilds">trunk</a> unless
42 otherwise noted:
43 </p>
45 <ul>
46 <li>
47 <code>rgb(0, 0, 0)</code> color declarations with spaces in shorthand <abbr>CSS</abbr>
48 properties (<code>border</code> or <code>background</code>)
49 are silently stripped. See <a href="http://htmlpurifier.org/phorum/read.php?3,1413,1452#msg-1439">this
50 forum topic</a> for a stop-gap fix. This problem usually occurs when
51 <acronym>WYSIWYG</acronym> editors use this syntax to specify colors.
52 </li>
53 <li>
54 Nested elements are not autoclosed; <code><![CDATA[<span><span><div>text]]></code>
55 results in <code><![CDATA[<span><span>text</span></span>]]></code> rather than the
56 expected <code><![CDATA[<span><span></span></span><div>text</div>]]></code>
57 </li>
58 <li>
59 Comment parsing with DirectLex is buggy (triggered by <a
60 href="live/configdoc/plain.html#HTML.Trusted">%HTML.Trusted</a>)
61 </li>
62 <li>
63 <abbr>CSS</abbr> in <code>style</code> blocks (with the ExtractStyleBlocks
64 filter) cannot be wrapped in <abbr>HTML</abbr> comments.
65 </li>
66 <li>
67 Versions of libxml later than 2.6.28 and <code>script</code> tags (triggered by <a
68 href="live/configdoc/plain.html#HTML.Trusted">%HTML.Trusted</a>) do not
69 play nicely together.
70 </li>
71 </ul>
72 -->
74 <h2 id="Standard">Standard</h2>
76 <p>
77 We offer the standard zip and tarball downloads. Download them,
78 unzip them, and with a few simple <a href="#Installation">installation</a> steps get
79 to using HTML Purifier right away:
80 </p>
82 <ul>
83 <li><a class="download" href="&url.dl;.tar.gz">HTML Purifier &htmlpurifier.current.version; (.tar.gz)</a> [<a href="&url.dl;.tar.gz.sig">sig</a>]</li>
84 <li><a class="download" href="&url.dl;.zip" >HTML Purifier &htmlpurifier.current.version; (.zip)</a> [<a href="&url.dl;.zip.sig">sig</a>]</li>
85 </ul>
87 <h3 id="Lite">Lite Distribution</h3>
89 <p>
90 No, it's not magically faster. HTML Purifier Lite offers the same
91 functionality of HTML Purifier (standard), except that anything not
92 essentially to the basic functioning of the library has been stripped
93 out: end-user documentation, unit-tests, profiling, maintenance scripts, etc.
94 Just the <code>library</code> folder.
95 </p>
97 <ul>
98 <li><a class="download" href="&url.dl;-lite.tar.gz">HTML Purifier &htmlpurifier.current.version; Lite (.tar.gz)</a> [<a href="&url.dl;-lite.tar.gz.sig">sig</a>]</li>
99 <li><a class="download" href="&url.dl;-lite.zip" >HTML Purifier &htmlpurifier.current.version; Lite (.zip)</a> [<a href="&url.dl;-lite.zip.sig">sig</a>]</li>
100 </ul>
102 <h3 id="Standalone">Standalone Distribution</h3>
105 For those of you who balk at the possibility of a 100+ includes, we also
106 offer a conveniently packaged single-file version of HTML Purifier. Well,
107 not really, since HTML Purifier does require some auxiliary files in
108 order to work (but they are neatly tucked away in a folder named
109 <code>standalone</code>). Include <code>HTMLPurifier.standalone.php</code>
110 and be done with it!
111 </p>
113 <ul>
114 <li><a class="download" href="&url.dl;-standalone.tar.gz">HTML Purifier &htmlpurifier.current.version; Standalone (.tar.gz)</a> [<a href="&url.dl;-standalone.tar.gz.sig">sig</a>]</li>
115 <li><a class="download" href="&url.dl;-standalone.zip" >HTML Purifier &htmlpurifier.current.version; Standalone (.zip)</a> [<a href="&url.dl;-standalone.zip.sig">sig</a>]</li>
116 </ul>
118 <h3 id="SHA1"><acronym>SHA-1</acronym> checksums</h3>
121 Here are the <acronym>SHA-1</acronym> checksums you can use to
122 verify the integrity of your HTML Purifier download:
123 </p>
125 <pre class="long">&htmlpurifier.current.hashes;</pre>
127 <h3 id="GnuPG">GnuPG signatures</h3>
130 There are <tt>.sig</tt> files which you can use to cryptographically verify
131 that the release is from me, Edward Z. Yang. You can find
132 my <a href="http://www.thewritingpot.com/gpgpubkey.asc">public key
133 here (0x869C48DA)</a>. My key's fingerprint is:
134 <tt>3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA</tt>.
135 </p>
137 <p>Verify files with this command:</p>
139 <pre class="command">gpg --verify <strong>$filename</strong>.sig</pre>
141 <h2 id="PEAR"><acronym>PEAR</acronym></h2>
144 HTML Purifier is also available via a <acronym>PEAR</acronym> channel.
145 The <acronym>PEAR</acronym> installer is an incredibly powerful and robust
146 way to install <abbr>PHP</abbr> packages, and
147 does not have to be limited to packages found on
148 <a href="http://pear.php.net/">pear.php.net</a>. With
149 <acronym>PEAR</acronym>, installing is as simple as these
150 two commands in your shell:
151 </p>
153 <pre class="command">pear channel-discover htmlpurifier.org
154 pear install hp/HTMLPurifier</pre>
157 ...and then following the <a href="#Installation">installation instructions</a>.
158 </p>
161 You can upgrade with:
162 </p>
164 <pre class="command">pear upgrade hp/HTMLPurifier</pre>
166 <h2 id="Subversion">Subversion</h2>
169 For those who like to live on the edge, you can also grab the latest
170 developmental code from our Subversion
171 repository. Simply execute this command in your shell (you must have
172 Subversion installed):
173 </p>
175 <pre class="command">svn co http://htmlpurifier.org/svnroot/htmlpurifier/trunk ./</pre>
178 Code in the trunk actually tends to be quite stable;
179 a combination of extensive unit-testing and atomic commits means that
180 the most recent version will almost never be broken.
181 </p>
184 For the less adventurous, you can take
185 a peek at specific files by <a href="http://htmlpurifier.org/svnroot/htmlpurifier/trunk/">browsing
186 anonymously</a> at the repository root or using
187 <a href="http://htmlpurifier.org/viewvc.cgi/htmlpurifier/trunk/">ViewVC to
188 view the repository</a>.
189 </p>
191 <h2 id="PHP4">HTML Purifier 2.1 for <abbr>PHP</abbr> 4</h2>
194 <strong>Warning:</strong> The HTML Purifier 2.1 series is retired and
195 will only be receiving major
196 bug and security fixes. However, it is compatible with <abbr>PHP</abbr> 4
197 so if you're stuck on this now officially deprecated version of
198 <abbr>PHP</abbr>, here are the older downloads:
199 </p>
201 <ul>
202 <li><a class="download" href="releases/htmlpurifier-2.1.5.tar.gz">HTML Purifier 2.1.5 (.tar.gz)</a></li>
203 <li><a class="download" href="releases/htmlpurifier-2.1.5.zip">HTML Purifier 2.1.5 (.zip)</a></li>
204 </ul>
206 <h2 id="NightlyBuilds">Nightly Builds</h2>
209 Nightly tarballs of the most recent SVN snapshots are available
210 for those of you who want to live on the edge but never got
211 <code>svn export</code> to work. These builds are <abbr>PHP</abbr>5 only.
212 The build is performed every day at midnight, and is available here:
213 </p>
215 <ul>
216 <li><a class="download" href="http://htmlpurifier.org/releases/htmlpurifier-trunk.tar.gz">HTML Purifier Trunk Snapshot (.tar.gz)</a></li>
217 <li><a class="download" href="http://htmlpurifier.org/releases/htmlpurifier-trunk-lite.tar.gz">HTML Purifier Trunk Snapshot Lite (.tar.gz)</a></li>
218 <li><a class="download" href="http://htmlpurifier.org/releases/htmlpurifier-trunk-standalone.tar.gz">HTML Purifier Trunk Snapshot Standalone (.tar.gz)</a></li>
219 </ul>
221 <h2 id="Installation">Installation</h2>
223 <h3>File permissions</h3>
226 <strong>Starting with HTML Purifier 2.0.0, it is vital that you set
227 proper directory permissions for where HTML Purifier writes out
228 some temporary files.</strong> Specifically, HTML Purifier will write
229 out cache files for HTMLDefinition in the subdirectories of
230 <code>HTMLPurifier/DefinitionCache/Serializer</code>. If you are in
231 the <code>library/</code> folder of HTML Purifier, you can set the
232 appropriate permissions using:
233 </p>
235 <pre class="command">chmod -R 0755 HTMLPurifier/DefinitionCache/Serializer</pre>
238 If the above command doesn't work, you may need to assign write permissions
239 to all. This may be necessary if your webserver runs as nobody, but is
240 not recommended since it means any other user can write files in the
241 directory. Use:
242 </p>
244 <pre class="command">chmod -R 0777 HTMLPurifier/DefinitionCache/Serializer</pre>
247 You can also chmod files via your <abbr>FTP</abbr> client; this option
248 is usually accessible by right clicking the corresponding directory and
249 then selecting <q>chmod</q> or <q>file permissions</q>.
250 </p>
253 If you are unable or unwilling to give write permissions to the cache
254 directory, you can either disable the cache (and suffer a performance
255 hit):
256 </p>
258 <pre>$config->set('Core', 'DefinitionCache', null);</pre>
261 Or move the cache directory somewhere else (no trailing slash):
262 </p>
264 <pre>$config->set('Cache', 'SerializerPath', '/home/user/absolute/path');</pre>
267 If there is a demand for it, future versions will also support
268 <a href="http://danga.com/memcached/">memcached</a>
269 as a caching system.
270 </p>
272 <h3>Quick install</h3>
274 <p>If your website is in UTF-8 and XHTML Transitional, use this code:</p>
276 <pre>&lt;?php
277 require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
279 $purifier = new HTMLPurifier();
280 $clean_html = $purifier->purify($dirty_html);
281 ?&gt;</pre>
283 <p>If your website is in a different encoding or doctype, use this code:</p>
285 <pre>&lt;?php
286 require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
288 $config = HTMLPurifier_Config::createDefault();
289 $config->set('Core', 'Encoding', <strong>'ISO-8859-1'</strong>); // replace with your encoding
290 $config->set('HTML', 'Doctype', <strong>'HTML 4.01 Transitional'</strong>); // replace with your doctype
291 $purifier = new HTMLPurifier($config);
293 $clean_html = $purifier->purify($dirty_html);
294 ?&gt;</pre>
297 People with HTML Purifier already in their path (<acronym>PEAR</acronym>,
298 for example) can use:
299 </p>
301 <pre>require_once 'HTMLPurifier.auto.php';</pre>
304 For detailed installation instructions, read the
305 <a href="http://htmlpurifier.org/svnroot/htmlpurifier/tags/&htmlpurifier.current.version;/INSTALL"><code>INSTALL</code></a>
306 document.
307 </p>
309 <h2 id="MailingList">Mailing list</h2>
312 You can be notified of new releases by a low-traffic announce list. Subscribe
313 here:
314 </p>
316 <form method="post" action="http://scripts.dreamhost.com/add_list.cgi">
317 <div>
318 <label for="name">Name</label>: <input type="text" name="name" id="name" />
319 <label for="email">E-mail</label>: <input type="text" name="email" id="email" />
320 </div>
321 <div>
322 <input type="submit" name="submit" value="Suscribe to Announcement List" />
323 <input type="submit" name="unsub" value="Unsubscribe" />
324 </div>
325 <input type="hidden" name="list" value="admin@htmlpurifier.org" />
326 <input type="hidden" name="domain" value="htmlpurifier.org" />
327 <input type="hidden" name="emailit" value="1" />
328 </form>
331 We take your privacy very seriously and will not use emails submitted
332 to this web form for any other purposes.
333 </p>
335 <h2 id="History">History</h2>
338 Previous releases can be obtained by browsing
339 the <a href="releases/">release directory</a>
340 or checking code out of the
341 <a href="http://htmlpurifier.org/svnroot/htmlpurifier/tags/">tags/
342 directory</a>. However, they are not supported and should not be used
343 in live environments. If you are having trouble upgrading, pop over
344 to <a href="http://htmlpurifier.org/phorum/">the forums</a> and get help.
345 </p>
347 </div>
349 </body>
350 </html>