mailto.php 679 B

123456789101112131415161718192021222324252627
  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. public $browsable = false;
  11. public function validate(&$uri, $config, $context) {
  12. parent::validate($uri, $config, $context);
  13. $uri->userinfo = null;
  14. $uri->host = null;
  15. $uri->port = null;
  16. // we need to validate path against RFC 2368's addr-spec
  17. return true;
  18. }
  19. }
  20. // vim: et sw=4 sts=4