PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Networking » Net_DNS » Bug #5339

Wrong test in Net_DNS_RR_NAPTR::rdatastr()

Details

Submitted2005-09-08 14:20 UTC
Fromvena at switch dot ch
Assignedbate
StatusClosed
PackageNet_DNS
PHP Version5.0.5
OSALL
Roadmaps(Not assigned)

Comments

[2005-09-08 14:20 UTC] vena at switch dot ch

Description:
------------
The test "if ($this->port)" in Net_DNS_RR_NAPTR::rdatastr() is
wrong, because you don't have in all cases the variable port
set.

A more appropriate test would be "if ($this->rdata)", because
this is what you actually want.

Test script:
---------------
<?php

require_once 'Net/DNS.php';

$resolver = new Net_DNS_Resolver();
$response = $resolver->query('7.6.5.1.8.6.2.4.4.1.4.e164.arpa.', 'NAPTR');
if ($response) {
foreach ($response->answer as $rr) {

$rr->display();
}
}

echo 'ok';

?>

Expected result:
----------------
display() should return the string with the data of the
response and not just "no-data".