3 require_once 'common.php';
5 echo '<?xml version="1.0" encoding="UTF-8" ?>';
7 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
8 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
9 <html xmlns
="http://www.w3.org/1999/xhtml">
11 <title
>HTML Purifier Preserve YouTube Smoketest
</title
>
12 <meta http
-equiv
="Content-Type" content
="text/html; charset=UTF-8" />
15 <h1
>HTML Purifier Preserve YouTube Smoketest
</h1
>
18 $string = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/BdU--T8rLns"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/BdU--T8rLns" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
20 $regular_purifier = new HTMLPurifier();
22 $youtube_purifier = new HTMLPurifier(array(
23 'Filter.YouTube' => true,
28 <p
><a href
="?break">Click here to see the unpurified
version (breaks validation
).</a
></p
>
30 if (isset($_GET['break'])) echo $string;
33 <h2
>Without YouTube exception
</h2
>
35 echo $regular_purifier->purify($string);
38 <h2
>With YouTube exception
</h2
>
40 echo $youtube_purifier->purify($string);