<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Add URI Scheme to HTMLPurifier</title>
		<link>https://www.cotonti.com</link>
		<description>Son konu mesajları</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Thu, 09 Apr 2026 14:27:44 -0000</pubDate>

		<item>
			<title>Macik</title>
			<description><![CDATA[<p>If it still actual, here are the example code — add it to `htmlpurifier.group_5.preset.php` (admin group preset):</p>

<pre class="brush:php;gutter:false;toolbar:false;">
class HTMLPurifier_URIScheme_tel extends HTMLPurifier_URIScheme {

	public $browsable = false;
	public $may_omit_host = true;

	public function doValidate(&amp;$uri, $config, $context) {
		$uri-&gt;userinfo = null;
		$uri-&gt;host     = null;
		$uri-&gt;port     = null;

		$validCalltoPhoneNumberPattern = '/^\+?[\(\)\.0-9_-]+$/i'; // &lt;---whatever pattern you want to force phone numbers to match
		$proposedPhoneNumber = $uri-&gt;path; // defined phone
		if (preg_match($validCalltoPhoneNumberPattern, $proposedPhoneNumber) !== 1) {
			return FALSE;
		} else {
			return TRUE;
		}
	}
}

$config-&gt;set('URI.AllowedSchemes', array ('http' =&gt; true, 'https' =&gt; true, 'mailto' =&gt; true, 'ftp' =&gt; true, 'nntp' =&gt; true, 'news' =&gt; true, 'tel' =&gt; true,));
HTMLPurifier_URISchemeRegistry::instance()-&gt;register(new HTMLPurifier_URIScheme_tel, $config);</pre>

<p><br />
For more detailed information, check these links:  </p>

<ul><li><a href="http://stackoverflow.com/questions/10458783/how-to-configure-html-purifier-to-allow-callto123-in-an-anchor-href-value" rel="nofollow">Same code with some comments</a></li>
	<li><a href="http://htmlpurifier.org/docs/enduser-uri-filter.html" rel="nofollow">HTMLPurifier URI Filters described</a></li>
	<li><a href="https://github.com/robbytaylor/htmlpurifier-tel" rel="nofollow">Another variant of code</a></li>
	<li><a href="http://tools.ietf.org/html/rfc3966" rel="nofollow">The tel URI for Telephone Numbers RFC 3966</a></li>
</ul><p><strong>Update</strong>: starting from version 4.8.0 HTML Purifier support `tel:` scheme by default.</p>
]]></description>
			<pubDate>Cum, 22 Oca 2016 22:45:43 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/tr/forums?m=posts&q=7666&d=0#post41317]]></link>
		</item>
		<item>
			<title>Hodges</title>
			<description><![CDATA[<p>Hi,</p>

<p>Can anyone help me add the <strong>tel:</strong> URI scheme to HTMLPurifier? All the example instructions on doing this refer to path structures dissimilar from Cotonti's implementation of HTMLPurifier.</p>

<p>Cheers,<br /><span style="line-height:1.6em;">Hodges</span></p>
]]></description>
			<pubDate>Çrş, 22 Oca 2014 17:14:55 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/tr/forums?m=posts&q=7666&d=0#post39056]]></link>
		</item>
	</channel>
</rss>