From:             misc at e2007 dot cynergi dot com
Operating system: RHEL4
PHP version:      5.2.4
PHP Bug Type:     Network related
Bug description:  dns_get_record() doesn't return all text from TXT record

Description:
------------
dns_get_record() doesn't return all text from TXT record.

RFC 1035 states that TXT record values can't have "compression", but can
have multiple strings for the same DNS record. Although uncommon, such long
TXT strings actualy exist to make publicly available public key data for
DomainKeys e-mail protocols (used by Yahoo! and Gmail).

The following code examples where compiled when under Windows, the command
"nslookup -type=TXT bravo._domainkey.yahoogroups.co.uk" returned:

(...)
Non-authoritative answer:
bravo._domainkey.yahoogroups.co.uk      text =

        "k=rsa;
p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAKt1OprXeH+okFnh8XxMeVV9iYAbhIOMq3ODHpcBm7JSl3Orusqv53BIn55a0JaP1iqbIWu5j3TVIpqbG7MHZU"
        "KJQrqcmVSvG7oT3r7Fwo6aCHMMuL+IZdEpbb9ZU8xomQIDAP//"


Reproduce code:
---------------
$x = dns_get_record("bravo._domainkey.yahoogroups.co.uk", DNS_TXT);
var_dump($x);


Expected result:
----------------
array(1) {
  [0]=>
  array(5) {
    ["host"]=>
    string(34) "bravo._domainkey.yahoogroups.co.uk"
    ["type"]=>
    string(3) "TXT"
    ["txt"]=>
    string(127) "k=rsa;
p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAKt1OprXeH+okFnh8XxMeVV9iYAbhIOMq3ODHpcBm7JSl3Orusqv53BIn55a0JaP1iqbIWu5j3TVIpqbG7MHZUKJQrqcmVSvG7oT3r7Fwo6aCHMMuL+IZdEpbb9ZU8xomQIDAP//"
    ["class"]=>
    string(2) "IN"
    ["ttl"]=>
    int(17428)
  }
}


Actual result:
--------------
array(1) {
  [0]=>
  array(5) {
    ["host"]=>
    string(34) "bravo._domainkey.yahoogroups.co.uk"
    ["type"]=>
    string(3) "TXT"
    ["txt"]=>
    string(127) "k=rsa;
p=MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAKt1OprXeH+okFnh8XxMeVV9iYAbhIOMq3ODHpcBm7JSl3Orusqv53BIn55a0JaP1iqbIWu5j3TVIpqbG7MHZU"
    ["class"]=>
    string(2) "IN"
    ["ttl"]=>
    int(17428)
  }
}


-- 
Edit bug report at http://bugs.php.net/?id=42855&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42855&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42855&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42855&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42855&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42855&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42855&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42855&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42855&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42855&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42855&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42855&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42855&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42855&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42855&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42855&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42855&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42855&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42855&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42855&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42855&r=mysqlcfg

Reply via email to