mirror of
https://github.com/friendica/friendica
synced 2025-04-29 16:24:23 +02:00
Support cid URLs as used in mailstream plugin
This commit is contained in:
parent
4dcdcd4d6f
commit
4a16d8e06f
2 changed files with 40 additions and 0 deletions
37
src/Content/Text/HTMLPurifier_URIScheme_cid.php
Normal file
37
src/Content/Text/HTMLPurifier_URIScheme_cid.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Content\Text;
|
||||
|
||||
use \HTMLPurifier_URIScheme;
|
||||
|
||||
/**
|
||||
* Validates content-id ("cid") as used in multi-part MIME messages, as defined by RFC 2392
|
||||
*/
|
||||
class HTMLPurifier_URIScheme_cid extends HTMLPurifier_URIScheme
|
||||
{
|
||||
/**
|
||||
* @type bool
|
||||
*/
|
||||
public $browsable = true;
|
||||
|
||||
/**
|
||||
* @type bool
|
||||
*/
|
||||
public $may_omit_host = true;
|
||||
|
||||
/**
|
||||
* @param HTMLPurifier_URI $uri
|
||||
* @param HTMLPurifier_Config $config
|
||||
* @param HTMLPurifier_Context $context
|
||||
* @return bool
|
||||
*/
|
||||
public function doValidate(&$uri, $config, $context)
|
||||
{
|
||||
$uri->userinfo = null;
|
||||
$uri->host = null;
|
||||
$uri->port = null;
|
||||
$uri->query = null;
|
||||
// typecode check needed on path
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue