mikepultz / netdns2

Native PHP DNS Resolver and Updater
https://netdns2.com/
Other
119 stars 64 forks source link

URI records contain URIs not host names #93

Closed gbxyz closed 5 years ago

gbxyz commented 5 years ago

The rrToString() and rrSet() methods of Net_DNS2_RR_URI used cleanString() and Net_DNS2_Packet::expand() (respectively) to munge the final part of the RR's rdata.

However these functions assume that what they are being given is a domain name, but a URI is not a domain name: for example, a trailing dot is permissable in URIs and should be preserved, and URIs are not compressed in the same way that domain names are in packets, so the target property of a Net_DNS2_RR_URI record is always NULL as Net_DNS2_Packet::expand() will always return NULL if it cannot successfully expand a compressed name.

This pull request fixes the rrToString() and rrSet() methods of Net_DNS2_RR_URI.

mikepultz commented 5 years ago

Thanks @gbxyz