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 {
|
|
|
|
|
|
|
|
function validateComponents(
|
2006-10-27 01:20:10 +00:00
|
|
|
$userinfo, $host, $port, $path, $query, $config, &$context
|
2006-08-12 19:11:21 +00:00
|
|
|
) {
|
|
|
|
list($userinfo, $host, $port, $path, $query) =
|
|
|
|
parent::validateComponents(
|
2006-10-27 01:20:10 +00:00
|
|
|
$userinfo, $host, $port, $path, $query, $config, $context );
|
2006-08-12 19:11:21 +00:00
|
|
|
// we need to validate path against RFC 2368's addr-spec
|
|
|
|
return array(null, null, null, $path, $query);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|