2006-08-12 19:11:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/URIScheme.php';
|
|
|
|
|
|
|
|
// VERY RELAXED! Shouldn't cause problems, not even Firefox checks if the
|
|
|
|
// email is valid, but be careful!
|
|
|
|
|
2006-08-20 22:06:11 +00:00
|
|
|
/**
|
|
|
|
* Validates mailto (for E-mail) according to RFC 2368
|
|
|
|
* @todo Validate the email address
|
|
|
|
* @todo Filter allowed query parameters
|
|
|
|
*/
|
|
|
|
|
2006-08-12 19:11:21 +00:00
|
|
|
class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme {
|
|
|
|
|
2006-11-17 23:09:10 +00:00
|
|
|
var $browsable = false;
|
|
|
|
|
2007-08-01 18:34:46 +00:00
|
|
|
function validate(&$uri, $config, &$context) {
|
|
|
|
parent::validate($uri, $config, $context);
|
|
|
|
$uri->userinfo = null;
|
|
|
|
$uri->host = null;
|
|
|
|
$uri->port = null;
|
2006-08-12 19:11:21 +00:00
|
|
|
// we need to validate path against RFC 2368's addr-spec
|
2007-08-01 18:34:46 +00:00
|
|
|
return true;
|
2006-08-12 19:11:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|