Home » Networking » Net_DNS » Bug #5339
Wrong test in Net_DNS_RR_NAPTR::rdatastr()
Details
| Submitted | 2005-09-08 14:20 UTC |
|---|---|
| From | vena at switch dot ch |
| Assigned | bate |
| Status | Closed |
| Package | Net_DNS |
| PHP Version | 5.0.5 |
| OS | ALL |
| 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".