summaryrefslogtreecommitdiffstats
path: root/Net_DNS2-php7.patch
blob: 5c8bb321c585b437a3f2586e4da87ca7b7cc45bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 7a0e8ab3727c5f52bdf9dfb3ec0fe154ca4e699a Mon Sep 17 00:00:00 2001
From: Mike Pultz <mike@mikepultz.com>
Date: Mon, 28 Nov 2016 19:30:44 -0500
Subject: [PATCH] - fixed a couple cases in NSAP.php where I was comparing a
 string to a integer - trunk is now v1.4.3

---
 Net/DNS2.php                  | 2 +-
 Net/DNS2/RR/NSAP.php          | 6 +++---
 composer.json                 | 4 ++--
 tests/Net_DNS2_DNSSECTest.php | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Net/DNS2.php b/Net/DNS2.php
index 672e1cb..093ecb0 100644
--- a/Net/DNS2.php
+++ b/Net/DNS2.php
@@ -72,7 +72,7 @@ class Net_DNS2
     /*
      * the current version of this library
      */
-    const VERSION = '1.4.2';
+    const VERSION = '1.4.3';
 
     /*
      * the default path to a resolv.conf file
diff --git a/Net/DNS2/RR/NSAP.php b/Net/DNS2/RR/NSAP.php
index b2b433a..b9d8a85 100644
--- a/Net/DNS2/RR/NSAP.php
+++ b/Net/DNS2/RR/NSAP.php
@@ -130,7 +130,7 @@ protected function rrFromString(array $rdata)
         //
         // make sure the afi value is 47
         //
-        if ($x['afi'] == 47) {
+        if ($x['afi'] == '47') {
 
             $this->afi  = '0x' . $x['afi'];
             $this->idi  = $x['idi'];
@@ -169,7 +169,7 @@ protected function rrSet(Net_DNS2_Packet &$packet)
             //
             // we only support AFI 47- there arent' any others defined.
             //
-            if ($this->afi == 47) {
+            if ($this->afi == '47') {
 
                 //
                 // unpack the rest of the values
@@ -212,7 +212,7 @@ protected function rrSet(Net_DNS2_Packet &$packet)
      */
     protected function rrGet(Net_DNS2_Packet &$packet)
     {
-        if ($this->afi == 0x47) {
+        if ($this->afi == '0x47') {
 
             //
             // build the aa field
diff --git a/tests/Net_DNS2_DNSSECTest.php b/tests/Net_DNS2_DNSSECTest.php
index 027d614..f9febfa 100644
--- a/tests/Net_DNS2_DNSSECTest.php
+++ b/tests/Net_DNS2_DNSSECTest.php
@@ -80,7 +80,7 @@ public function testDNSSEC()
         $r->dnssec = true;
 
         $result = $r->query('org', 'SOA', 'IN');
-print_r($result);
+
         $this->assertTrue(($result->header->ad == 1));
         $this->assertTrue(($result->additional[0] instanceof Net_DNS2_RR_OPT));
         $this->assertTrue(($result->additional[0]->do == 1));