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 #4998

Wrong test in SRV::rr_rdata()

Details

Submitted2005-08-04 16:45 UTC
Fromromain at ludicre dot net
Assignedbate
StatusClosed
PackageNet_DNS
PHP Version4.3.10
OSLinux
Roadmaps(Not assigned)

Comments

[2005-08-04 16:45 UTC] romain at ludicre dot net

Description:
------------
Using Net_DNS 1.0.0rc1

In Net/DNS/SRV.php, method rr_rdata() tests whether the priority value is true to decide whether it returns the record data or NULL.

This prevents from getting/upgrading records having the priority set to 0.

It should test whether the prioriry is set or not instead.

Test script:
---------------
Net/DNS/SRV.php, method rr_rdata():

function rr_rdata($packet, $offset)
{
if ($this->preference) {
$rdata = pack('nnn', $this->preference, $this->weight, $this->port);
$rdata .= $packet->dn_comp($this->target, $offset + strlen($rdata));
return($rdata);
}
return(NULL);
}

You should replace :

if ($this->preference) {

by

if (isset($this->preference)) {