From 4fa397c6c3413fb4d7ede82e09336203eb6c193a Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Wed, 22 Aug 2007 22:57:03 +0000 Subject: [PATCH] fixing issues with .eu.be and .name whois servers (new syntax) Fixes #571 --- .gitattributes | 1 + bureau/class/m_dom.php | 3 ++- tests/whois_test.php | 26 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 tests/whois_test.php diff --git a/.gitattributes b/.gitattributes index a5ddffbd..838b895d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -351,6 +351,7 @@ src/slave_dns -text src/spoolsize.php -text src/sqlbackup.sh -text src/update_domains.sh -text +tests/whois_test.php -text tools/get_account_by_domain -text tools/get_domains_by_account -text tools/top_ftp_users -text diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 4daa42a9..ce578875 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -336,6 +336,7 @@ class m_dom { break; case "name": $serveur="whois.nic.name"; + $egal="domain = "; break; case "ws": $serveur="whois.samoanic.ws"; @@ -392,7 +393,7 @@ class m_dom { break; case "eu": case "be": - $ligne=ereg_replace(chr(10), "",ereg_replace(chr(13),"",ereg_replace(" ","", $ligne))); + $ligne=preg_replace("/^ *([^ ]*) \(.*\)$/","\\1",trim($ligne)); if($found) $tmp = trim($ligne); if ($tmp) diff --git a/tests/whois_test.php b/tests/whois_test.php new file mode 100755 index 00000000..f5d91eb5 --- /dev/null +++ b/tests/whois_test.php @@ -0,0 +1,26 @@ +#!/usr/bin/php +whois($d); + if (is_array($srv)) { + foreach($srv as $s) { + echo " Nameserver: $s\n"; + } + } else { + echo " No nameserver found !\n"; + } +} + +?> \ No newline at end of file