From 86c29961633fc4c004d1746c50449e5331ecf897 Mon Sep 17 00:00:00 2001 From: henoheno Date: Sat, 27 Dec 2008 20:50:55 +0900 Subject: [PATCH] host_normalize(): Don't cut 'www' with Non-ASCII-based string such as IDN --- spam/SpamPickupTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spam/SpamPickupTest.php b/spam/SpamPickupTest.php index df80d22..8f0d5ec 100644 --- a/spam/SpamPickupTest.php +++ b/spam/SpamPickupTest.php @@ -1,5 +1,5 @@ setup_string_null() as $key => $value){ $this->assertEquals('', host_normalize($value), $key); } @@ -62,8 +62,12 @@ class SpamPickupTest extends PHPUnit_TestCase // Hostname is case-insensitive $this->assertEquals('example.org', host_normalize('ExAMPle.ORG')); - // Cut 'www' (destructive) + // Cut 'www' with traditional ASCII-based FQDN (destructive) $this->assertEquals('example.org', host_normalize('WWW.example.org')); + + // Don't cut 'www' with Non-ASCII-based string such as IDN + $this->assertEquals("www.example.org\0foobar", + host_normalize("WWW.example.org\0foobar")); } function testFunc_port_normalize() -- 2.11.0