ℹ️ Your data is safe here... unless you make the SNIP gods angry. And let's just say they have a really bad sense of humor.

From librenms, 6 Years ago, written in Plain Text.
Embed
  1. diff --git a/includes/common.php b/includes/common.php
  2. index 4d58f60aa..d98423368 100644
  3. --- a/includes/common.php
  4. +++ b/includes/common.php
  5. @@ -649,7 +649,7 @@ function is_valid_hostname($hostname)
  6.      // maximum length is 253 characters, maximum segment size is 63
  7.  
  8.      return (
  9. -        preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*\.?$/i", $hostname) //valid chars check
  10. +        preg_match("/^([a-z\d](-*[a-z\d_])*)(\.([a-z\d](-*[a-z\d])*))*\.?$/i", $hostname) //valid chars check
  11.          && preg_match("/^.{1,253}$/", $hostname) //overall length check
  12.          && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*\.?$/", $hostname)
  13.      );
  14.  
captcha