add a cid scheme to purifiers URI schemes, to be able to process inlineimages in eMails.

This commit is contained in:
Klaus Leithoff 2009-12-02 14:41:44 +00:00
parent c3df45932f
commit 8d3d3c8a6d

View File

@ -0,0 +1,25 @@
<?php
/**
* Validates cid (internal images in emails)
* @todo Filter allowed query parameters
*/
class HTMLPurifier_URIScheme_cid extends HTMLPurifier_URIScheme {
public $browsable = true;
public function validate(&$uri, $config, $context) {
//error_log(__METHOD__." calledi with:".print_r($uri,true));
//parent::validate($uri, $config, $context);
$uri->userinfo = null;
$uri->host = null;
$uri->port = null;
$uri->query = null;
if (!empty($uri->path)) return true;
return false;
}
}
HTMLPurifier_URISchemeRegistry::instance()->register('cid', new HTMLPurifier_URIScheme_cid());
// vim: et sw=4 sts=4