refactor: Allow setting the target shorthost length. (#7453)

* Create a target shorthost length. Addresses #7452.

* Update defaults.inc.php
This commit is contained in:
Jonathan Lassoff
2017-11-09 20:47:52 +00:00
committed by Neil Lathwood
parent 3f27357951
commit fe8d011dce
2 changed files with 9 additions and 0 deletions

View File

@@ -86,6 +86,7 @@ function shorthost($hostname, $len = 12)
if (filter_var($hostname, FILTER_VALIDATE_IP)) {
return $hostname;
}
$len = Config::get('shorthost_target_length', $len);
$parts = explode(".", $hostname);
$shorthost = $parts[0];