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.

41 lines
893B

  1. <?php
  2. // VERY RELAXED! Shouldn't cause problems, not even Firefox checks if the
  3. // email is valid, but be careful!
  4. /**
  5. * Validates mailto (for E-mail) according to RFC 2368
  6. * @todo Validate the email address
  7. * @todo Filter allowed query parameters
  8. */
  9. class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme
  10. {
  11. /**
  12. * @type bool
  13. */
  14. public $browsable = false;
  15. /**
  16. * @type bool
  17. */
  18. public $may_omit_host = true;
  19. /**
  20. * @param HTMLPurifier_URI $uri
  21. * @param HTMLPurifier_Config $config
  22. * @param HTMLPurifier_Context $context
  23. * @return bool
  24. */
  25. public function doValidate(&$uri, $config, $context)
  26. {
  27. $uri->userinfo = null;
  28. $uri->host = null;
  29. $uri->port = null;
  30. // we need to validate path against RFC 2368's addr-spec
  31. return true;
  32. }
  33. }
  34. // vim: et sw=4 sts=4