Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
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.

23 lines
545 B

  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