mailto.php 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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