XHTML 2 is dead. Long live XHTML 2.
[htmlpurifier.git] / smoketests / preserveYouTube.php
blob52f04a02e473521c1145d446c07730372fdbfc87
1 <?php
3 require_once 'common.php';
5 echo '<?xml version="1.0" encoding="UTF-8" ?>';
6 ?><!DOCTYPE html
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">
10 <head>
11 <title>HTML Purifier Preserve YouTube Smoketest</title>
12 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
13 </head>
14 <body>
15 <h1>HTML Purifier Preserve YouTube Smoketest</h1>
16 <?php
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,
24 ));
27 <h2>Unpurified</h2>
28 <p><a href="?break">Click here to see the unpurified version (breaks validation).</a></p>
29 <div><?php
30 if (isset($_GET['break'])) echo $string;
31 ?></div>
33 <h2>Without YouTube exception</h2>
34 <div><?php
35 echo $regular_purifier->purify($string);
36 ?></div>
38 <h2>With YouTube exception</h2>
39 <div><?php
40 echo $youtube_purifier->purify($string);
41 ?></div>
43 </body>
44 </html>
45 <?php
47 // vim: et sw=4 sts=4