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.

32 lines
684B

  1. <?php
  2. /**
  3. * Meta-class for HTML Purifier's extra class hierarchies, similar to
  4. * HTMLPurifier_Bootstrap.
  5. */
  6. class HTMLPurifierExtras
  7. {
  8. public static function autoload($class)
  9. {
  10. $path = HTMLPurifierExtras::getPath($class);
  11. if (!$path) return false;
  12. require $path;
  13. return true;
  14. }
  15. public static function getPath($class)
  16. {
  17. if (
  18. strncmp('FSTools', $class, 7) !== 0 &&
  19. strncmp('ConfigDoc', $class, 9) !== 0
  20. ) return false;
  21. // Custom implementations can go here
  22. // Standard implementation:
  23. return str_replace('_', '/', $class) . '.php';
  24. }
  25. }
  26. // vim: et sw=4 sts=4