Prepended constants with C_ to avoid reserved words as per https://www.php.net/manual...
[htmlpurifier/darkodev.git] / smoketests / preserveYouTube.php
blob1dfa85cb6a14db60ca2002bf24edc4ea38997500
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 <object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/uNxBeJNyAqA&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/uNxBeJNyAqA&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
24 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="385" width="480"><param name="width" value="480" /><param name="height" value="385" /><param name="src" value="http://www.youtube.com/p/E37ADDDFCA0FD050&amp;hl=en" /><embed height="385" src="http://www.youtube.com/p/E37ADDDFCA0FD050&amp;hl=en" type="application/x-shockwave-flash" width="480"></embed></object>
26 <object
27 classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
28 id="ooyalaPlayer_229z0_gbps1mrs" width="630" height="354"
29 codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param
30 name="movie" value="http://player.ooyala.com/player.swf?embedCode=FpZnZwMTo1wqBF-ed2__OUBb3V4HR6za&version=2"
31 /><param name="bgcolor" value="#000000" /><param
32 name="allowScriptAccess" value="always" /><param
33 name="allowFullScreen" value="true" /><param name="flashvars"
34 value="embedType=noscriptObjectTag&embedCode=pteGRrMTpcKMyQ052c8NwYZ5M5FdSV3j"
35 /><embed src="http://player.ooyala.com/player.swf?embedCode=FpZnZwMTo1wqBF-ed2__OUBb3V4HR6za&version=2"
36 bgcolor="#000000" width="630" height="354"
37 name="ooyalaPlayer_229z0_gbps1mrs" align="middle" play="true"
38 loop="false" allowscriptaccess="always" allowfullscreen="true"
39 type="application/x-shockwave-flash"
40 flashvars="&embedCode=FpZnZwMTo1wqBF-ed2__OUBb3V4HR6za"
41 pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object>
44 $regular_purifier = new HTMLPurifier();
46 $safeobject_purifier = new HTMLPurifier(array(
47 'HTML.SafeObject' => true,
48 'Output.FlashCompat' => true,
49 ));
52 <h2>Unpurified</h2>
53 <p><a href="?break">Click here to see the unpurified version (breaks validation).</a></p>
54 <div><?php
55 if (isset($_GET['break'])) echo $string;
56 ?></div>
58 <h2>Without YouTube exception</h2>
59 <div><?php
60 echo $regular_purifier->purify($string);
61 ?></div>
63 <h2>With SafeObject exception and flash compatibility</h2>
64 <div><?php
65 echo $safeobject_purifier->purify($string);
66 ?></div>
68 </body>
69 </html>
70 <?php
72 // vim: et sw=4 sts=4