You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HTMLPurifier.func.php 576B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @file
  4. * Defines a function wrapper for HTML Purifier for quick use.
  5. * @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
  6. */
  7. /**
  8. * Purify HTML.
  9. * @param string $html String HTML to purify
  10. * @param mixed $config Configuration to use, can be any value accepted by
  11. * HTMLPurifier_Config::create()
  12. * @return string
  13. */
  14. function HTMLPurifier($html, $config = null)
  15. {
  16. static $purifier = false;
  17. if (!$purifier) {
  18. $purifier = new HTMLPurifier();
  19. }
  20. return $purifier->purify($html, $config);
  21. }
  22. // vim: et sw=4 sts=4