HTMLPurifier.func.php 545 B

1234567891011121314151617181920212223
  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 $html String HTML to purify
  10. * @param $config Configuration to use, can be any value accepted by
  11. * HTMLPurifier_Config::create()
  12. */
  13. function HTMLPurifier($html, $config = null) {
  14. static $purifier = false;
  15. if (!$purifier) {
  16. $purifier = new HTMLPurifier();
  17. }
  18. return $purifier->purify($html, $config);
  19. }
  20. // vim: et sw=4 sts=4