, .
:
:
/htmlpurifier-4_4_0/library/HTMLPurifier/URIScheme/
: callto.php
... :
<?php
class HTMLPurifier_URIScheme_callto extends HTMLPurifier_URIScheme {
public $browsable = false;
public $may_omit_host = true;
public function doValidate(&$uri, $config, $context) {
$uri->userinfo = null;
$uri->host = null;
$uri->port = null;
$validCalltoPhoneNumberPattern = '/^\+?[a-zA-Z0-9_-]+$/i';
$proposedPhoneNumber = $uri->path;
if (preg_match($validCalltoPhoneNumberPattern, $proposedPhoneNumber) !== 1) {
return FALSE;
} else {
return TRUE;
}
}
}
... HTMLpurifier., , - :
$config->set('URI.AllowedSchemes', array ('http' => true, 'https' => true, 'mailto' => true, 'ftp' => true, 'nntp' => true, 'news' => true, 'callto' => true,));