1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +02:00

Optional support for IDNAs with PEAR Net_IDNA2

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
Edward Z. Yang
2012-01-06 05:28:00 -08:00
parent 94468f3c24
commit 974fe3f25e
9 changed files with 75 additions and 7 deletions

View File

@@ -35,6 +35,17 @@ class HTMLPurifier_AttrDef_URI_HostTest extends HTMLPurifier_AttrDefHarness
$this->assertDef('f1.top');
$this->assertDef('f-.top', false);
$this->assertDef("\xE4\xB8\xAD\xE6\x96\x87.com.cn", false);
}
function testIDNA() {
if (!$GLOBALS['HTMLPurifierTest']['Net_IDNA2']) {
return false;
}
$this->config->set('Core.EnableIDNA', true);
$this->assertDef("\xE4\xB8\xAD\xE6\x96\x87.com.cn", "xn--fiq228c.com.cn");
$this->assertDef("\xe2\x80\x85.com", false); // rejected
}
}