Subversion Repositories vgwhois

Rev

Rev 77 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 77 Rev 107
Line 3... Line 3...
3
 
3
 
4
#
4
#
5
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
5
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
6
#  Maintenance / Developer utilities
6
#  Maintenance / Developer utilities
7
#
7
#
8
#  (c) 2012-2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
8
#  (c) 2012-2022 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
9
#
9
#
10
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
10
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
11
#
11
#
12
 
12
 
13
require_once __DIR__ . '/config.inc.php';
13
require_once __DIR__ . '/config.inc.php';
Line 40... Line 40...
40
		if (!$whois_serv) {
40
		if (!$whois_serv) {
41
			// Nothing found. Just update last check date.
41
			// Nothing found. Just update last check date.
42
			return str_replace($in_ts, date('Y-m-d'), $in_all);
42
			return str_replace($in_ts, date('Y-m-d'), $in_all);
43
		} else {
43
		} else {
44
			// Update the entry
44
			// Update the entry
45
			return ":whois|$whois_serv\n.${in_tld}\$\n";
45
			return ":whois|$whois_serv\n\\.${in_tld}\$\n";
46
		}
46
		}
47
	},
47
	},
48
	$domains_cont_original
48
	$domains_cont_original
49
);
49
);
50
 
50
 
Line 75... Line 75...
75
			$to_append .= ":whois|$whois_serv\n";
75
			$to_append .= ":whois|$whois_serv\n";
76
		} else {
76
		} else {
77
			$to_append .= "# TODO: Entry generated automatically. Needs manual check.\n";
77
			$to_append .= "# TODO: Entry generated automatically. Needs manual check.\n";
78
			$to_append .= ":notice||Whois server unknown (".date('Y-m-d').")\n";
78
			$to_append .= ":notice||Whois server unknown (".date('Y-m-d').")\n";
79
		}
79
		}
80
		$to_append .= "\\.$tld$\n";
80
		$to_append .= "\\.$tld\$\n";
81
 
81
 
82
		file_put_contents(DOMAINS_PATTERN_FILE, $to_append, FILE_APPEND);
82
		file_put_contents(DOMAINS_PATTERN_FILE, $to_append, FILE_APPEND);
83
 
83
 
84
		gwi_update_domains_patternfile();
84
		gwi_update_domains_patternfile();
85
 
85
 
Line 152... Line 152...
152
}
152
}
153
 
153
 
154
function iana_get_rootzone_whois_server($tld) {
154
function iana_get_rootzone_whois_server($tld) {
155
	$tld  = strtolower($tld);
155
	$tld  = strtolower($tld);
156
	$cont = QueryWhoisServer('whois.iana.org', $tld);
156
	$cont = QueryWhoisServer('whois.iana.org', $tld);
157
	if (!preg_match('@whois:\\s*(\\S+)@i', $cont, $m)) return false;
157
	if (!preg_match('@whois:[ \\t]*(\\S+)@i', $cont, $m)) return false;
158
	return $m[1];
158
	return $m[1];
159
}
159
}