Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

dataScheme.php 1.0KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. require_once 'common.php';
  3. echo '<?xml version="1.0" encoding="UTF-8" ?>';
  4. ?><!DOCTYPE html
  5. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  6. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <title>HTML Purifier data Scheme Smoketest</title>
  10. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  11. </head>
  12. <body>
  13. <h1>HTML Purifier data Scheme Smoketest</h1>
  14. <?php
  15. $string = '<img src="data:image/png;base64,
  16. iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP
  17. C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA
  18. AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J
  19. REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq
  20. ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0
  21. vr4MkhoXe0rZigAAAABJRU5ErkJggg==" alt="Red dot" />';
  22. $purifier = new HTMLPurifier(array('URI.AllowedSchemes' => 'data'));
  23. ?>
  24. <div><?php
  25. echo $purifier->purify($string);
  26. ?></div>
  27. </body>
  28. </html>
  29. <?php
  30. // vim: et sw=4 sts=4