Implement auto-formatter that removes empty span tags.
[htmlpurifier.git] / smoketests / preserveYouTube.php
blobc1b74dbec26e4172365fe0c730cd753d080d9d37
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 <object width="416" height="337"><param name="movie" value="http://www.youtube.com/cp/vjVQa1PpcFNbP_fag8PvopkXZyiXyT0J8U47lw7x5Fc="></param><embed src="http://www.youtube.com/cp/vjVQa1PpcFNbP_fag8PvopkXZyiXyT0J8U47lw7x5Fc=" type="application/x-shockwave-flash" width="416" height="337"></embed></object>';
22 $regular_purifier = new HTMLPurifier();
24 $youtube_purifier = new HTMLPurifier(array(
25 'Filter.YouTube' => true,
26 ));
29 <h2>Unpurified</h2>
30 <p><a href="?break">Click here to see the unpurified version (breaks validation).</a></p>
31 <div><?php
32 if (isset($_GET['break'])) echo $string;
33 ?></div>
35 <h2>Without YouTube exception</h2>
36 <div><?php
37 echo $regular_purifier->purify($string);
38 ?></div>
40 <h2>With YouTube exception</h2>
41 <div><?php
42 echo $youtube_purifier->purify($string);
43 ?></div>
45 </body>
46 </html>
47 <?php
49 // vim: et sw=4 sts=4