[dev] [commits] Horde branch develop updated. 2cd26a26e02a3c15e50c6a7bbf2f59397288f9bf
Michael M Slusarz
slusarz at horde.org
Wed Aug 29 15:18:10 UTC 2012
Quoting Jan Schneider <jan at horde.org>:
> It's not about false negatives but false positives, which we care
> about in this our use case. See my committed test.
This test is wrong:
$address3 = new Horde_Mail_Rfc822_Address('Test
<test at example.co.uk>');
[...]
$this->assertFalse($address3->matchDomain('co.uk'));
This should be:
$this->assertTrue($address3->matchDomain('co.uk'));
The address "test at example.co.uk" is in the domain "co.uk". So
matchDomain('co.uk') SHOULD return true. 'example.co.uk' is, by
definition, a subdomain of 'co.uk'. From RFC 1034:
"A domain is a subdomain of another domain if it is contained within
that domain."
Put another way:
$address = new Horde_Mail_Rfc822_Address('Test <test at example.com>');
$this->assertTrue($address->matchDomain('com'));
'com' is a perfectly valid domain. And 'example.com' is in the 'com' domain.
michael
___________________________________
Michael Slusarz [slusarz at horde.org]
More information about the dev
mailing list