title: HTMLPurifier iframe Vimeo and Youtube video
body: <p>How can I use HTMLPurifier to filter xss but also to allow iframe Vimeo and Youtube video?</p>
  
  <pre><code>require_once 'htmlpurifier/library/HTMLPurifier.auto.php';
  $config = HTMLPurifier_Config::createDefault();
  $config-&gt;set('HTML.Trusted', true);
  
  $config-&gt;set('Filter.YouTube', true);
  $config-&gt;set('HTML.DefinitionID', '1');
  $config-&gt;set('HTML.SafeObject', 'true');
  $config-&gt;set('Output.FlashCompat', 'true');
  
  $config-&gt;set('HTML.FlashAllowFullScreen', 'true');
  
  $purifier = new HTMLPurifier($config);
  $temp = $purifier-&gt;purify($temp);
  </code></pre>