mirror of
https://github.com/danog/LibDNSNative.git
synced 2024-11-30 04:29:07 +01:00
Fixes
This commit is contained in:
parent
f50d324faf
commit
5937c4d309
@ -97,10 +97,7 @@ class NativeDecoder
|
|||||||
{
|
{
|
||||||
/** @var \LibDNS\Records\Types\DomainName $domainName */
|
/** @var \LibDNS\Records\Types\DomainName $domainName */
|
||||||
$domainName = $this->typeBuilder->build(Types::DOMAIN_NAME);
|
$domainName = $this->typeBuilder->build(Types::DOMAIN_NAME);
|
||||||
$labels = \explode('.', $name);
|
$labels = \explode('.', rtrim($name, '.'));
|
||||||
if ('' !== $last = \array_pop($labels)) {
|
|
||||||
$labels[] = $last;
|
|
||||||
}
|
|
||||||
$domainName->setLabels($labels);
|
$domainName->setLabels($labels);
|
||||||
|
|
||||||
$question = $this->questionFactory->create($type);
|
$question = $this->questionFactory->create($type);
|
||||||
@ -190,10 +187,7 @@ class NativeDecoder
|
|||||||
if (!$encodingContext->isTruncated()) {
|
if (!$encodingContext->isTruncated()) {
|
||||||
/** @var \LibDNS\Records\Types\DomainName $domainName */
|
/** @var \LibDNS\Records\Types\DomainName $domainName */
|
||||||
$domainName = $this->typeBuilder->build(Types::DOMAIN_NAME);
|
$domainName = $this->typeBuilder->build(Types::DOMAIN_NAME);
|
||||||
$labels = \explode('.', $record['host']);
|
$labels = \explode('.', rtrim($record['host'], '.'));
|
||||||
if ('' !== $last = \array_pop($labels)) {
|
|
||||||
$labels[] = $last;
|
|
||||||
}
|
|
||||||
$domainName->setLabels($labels);
|
$domainName->setLabels($labels);
|
||||||
|
|
||||||
$packet = $encodingContext->getPacket();
|
$packet = $encodingContext->getPacket();
|
||||||
|
Loading…
Reference in New Issue
Block a user