|
Revision 21, 0.7 kB
(checked in by admin, 18 years ago)
|
|
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | // VERY RELAXED! Shouldn't cause problems, not even Firefox checks if the |
|---|
| 4 | // email is valid, but be careful! |
|---|
| 5 | |
|---|
| 6 | /** |
|---|
| 7 | * Validates mailto (for E-mail) according to RFC 2368 |
|---|
| 8 | * @todo Validate the email address |
|---|
| 9 | * @todo Filter allowed query parameters |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme { |
|---|
| 13 | |
|---|
| 14 | public $browsable = false; |
|---|
| 15 | |
|---|
| 16 | public function validate(&$uri, $config, $context) { |
|---|
| 17 | parent::validate($uri, $config, $context); |
|---|
| 18 | $uri->userinfo = null; |
|---|
| 19 | $uri->host = null; |
|---|
| 20 | $uri->port = null; |
|---|
| 21 | // we need to validate path against RFC 2368's addr-spec |
|---|
| 22 | return true; |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | } |
|---|
| 26 | |
|---|