$result = @file_get_contents($url); if (!$result) $result = _("Cannot retrieve whois information for this domain."); } else { // Whois protocol $text_plain = true; $result = ""; $sock = @fsockopen($chunks[1], 43, $errno, $errstr, 5); if (!$sock) $result = _("Failed to connect to whois server."); else { $domain_name = Punycode::Encode("{$domainname}.{$TLD}"); @fwrite($sock, "{$domain_name}\n"); while (!feof($sock)) { $result .= trim(@fread($sock, 1024)); } } } break; } } } if (!$result) {
/** * Encode a given UTF-8 string * * @param string $utf8_string (UTF-8 or UCS-4) * @return string ACE string */ public function PunycodeEncode($utf8_string) { return Punycode::Encode($utf8_string); }
} catch (RegistryException $e) { print "{$e->getMessage()}\n"; } } break; case "se-cancel-delete": if ($Registry && $domainname) { $module = $Registry->GetModule(); try { $module->Request("test-domain-delete", array("name" => "{$domainname}.{$tld}", "clientDelete" => 0)); print "Cancel delete request for '{$domainname}.{$tld}' is sent\n"; } catch (RegistryException $e) { print "{$e->getMessage()}\n"; } } break; case "idn-decode": print Punycode::Decode($argv[2]) . "\n"; break; case "idn-encode": print Punycode::Encode($argv[2]) . "\n"; break; case "is-idn": print preg_match('/[\\x00-\\x1F\\x7F-\\xFF]+/', $argv[2]) ? "Yes\n" : "No\n"; break; case "decrypt": $str = $argv[2]; $key = $argv[3]; print $Crypto->Decrypt($str, $key) . "\n"; break; }