Merge pull request #6063 from vieux/improve_number_detection

improve numeric only id detection
This commit is contained in:
unclejack 2014-05-28 00:36:57 +03:00
commit 70c6d806c8

View file

@ -514,7 +514,7 @@ func GenerateRandomID() string {
// if we try to parse the truncated for as an int and we don't have
// an error then the value is all numberic and causes issues when
// used as a hostname. ref #3869
if _, err := strconv.Atoi(TruncateID(value)); err == nil {
if _, err := strconv.ParseInt(TruncateID(value), 10, 64); err == nil {
continue
}
return value