Rewrite netcmd and ripe whois tools (#9724)

* Port RIPE whois to Laravel

* remove netcmd.php and port to laravel.
Escape CLI and set it to stream output live.

* fix browser buffer bust on a few browsers.
This commit is contained in:
Tony Murray
2019-01-25 15:30:58 -06:00
committed by GitHub
parent 003f3bdce0
commit ce6fae8dd1
17 changed files with 482 additions and 173 deletions

View File

@@ -651,22 +651,7 @@ function format_number($value, $base = '1000', $round = 2, $sf = 3)
function is_valid_hostname($hostname)
{
// The Internet standards (Request for Comments) for protocols mandate that
// component hostname labels may contain only the ASCII letters 'a' through 'z'
// (in a case-insensitive manner), the digits '0' through '9', and the hyphen
// ('-'). The original specification of hostnames in RFC 952, mandated that
// labels could not start with a digit or with a hyphen, and must not end with
// a hyphen. However, a subsequent specification (RFC 1123) permitted hostname
// labels to start with digits. No other symbols, punctuation characters, or
// white space are permitted. While a hostname may not contain other characters,
// such as the underscore character (_), other DNS names may contain the underscore
// maximum length is 253 characters, maximum segment size is 63
return (
preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*\.?$/i", $hostname) //valid chars check
&& preg_match("/^.{1,253}$/", $hostname) //overall length check
&& preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*\.?$/", $hostname)
);
return \LibreNMS\Util\Validate::hostname($hostname);
}
/*