mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-07 06:36:44 +02:00
tel protocol support.
This commit is contained in:
committed by
Edward Z. Yang
parent
a11aeab4a6
commit
cc35c8eb8c
@@ -22,6 +22,7 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
|
||||
$this->assertDef('news:rec.alt');
|
||||
$this->assertDef('nntp://news.example.com/324234');
|
||||
$this->assertDef('mailto:bob@example.com');
|
||||
$this->assertDef('tel:+15555555555');
|
||||
}
|
||||
|
||||
public function testIntegrationWithPercentEncoder()
|
||||
|
@@ -37,6 +37,11 @@ class HTMLPurifier_URIFilter_MakeAbsoluteTest extends HTMLPurifier_URIFilterHarn
|
||||
$this->assertFiltering('mailto:bob@example.com');
|
||||
}
|
||||
|
||||
public function testPreserveAltSchemeWithTel()
|
||||
{
|
||||
$this->assertFiltering('tel:+15555555555');
|
||||
}
|
||||
|
||||
public function testFilterIgnoreHTTPSpecialCase()
|
||||
{
|
||||
$this->assertFiltering('http:/', 'http://example.com/');
|
||||
|
@@ -69,6 +69,14 @@ class HTMLPurifier_URIParserTest extends HTMLPurifier_Harness
|
||||
);
|
||||
}
|
||||
|
||||
public function testTelURI()
|
||||
{
|
||||
$this->assertParsing(
|
||||
'tel:+1 (555) 555-5555',
|
||||
'tel', null, null, null, '+1 (555) 555-5555', null, null
|
||||
);
|
||||
}
|
||||
|
||||
public function testIPv4Address()
|
||||
{
|
||||
$this->assertParsing(
|
||||
|
@@ -172,6 +172,42 @@ class HTMLPurifier_URISchemeTest extends HTMLPurifier_URIHarness
|
||||
);
|
||||
}
|
||||
|
||||
public function test_tel_strip_punctuation()
|
||||
{
|
||||
$this->assertValidation(
|
||||
'tel:+1 (555) 555-5555', 'tel:+15555555555'
|
||||
);
|
||||
}
|
||||
|
||||
public function test_tel_regular()
|
||||
{
|
||||
$this->assertValidation(
|
||||
'tel:+15555555555'
|
||||
);
|
||||
}
|
||||
|
||||
public function test_tel_with_extension()
|
||||
{
|
||||
$this->assertValidation(
|
||||
'tel:+1-555-555-5555x123', 'tel:+15555555555x123'
|
||||
);
|
||||
}
|
||||
|
||||
public function test_tel_no_plus()
|
||||
{
|
||||
$this->assertValidation(
|
||||
'tel:555-555-5555', 'tel:5555555555'
|
||||
);
|
||||
}
|
||||
|
||||
public function test_tel_strip_letters()
|
||||
{
|
||||
$this->assertValidation(
|
||||
'tel:abcd1234',
|
||||
'tel:1234'
|
||||
);
|
||||
}
|
||||
|
||||
public function test_data_png()
|
||||
{
|
||||
$this->assertValidation(
|
||||
|
Reference in New Issue
Block a user