فهرست منبع

Merge pull request #6063 from vieux/improve_number_detection

improve numeric only id detection
unclejack 11 سال پیش
والد
کامیت
70c6d806c8
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      utils/utils.go

+ 1 - 1
utils/utils.go

@@ -514,7 +514,7 @@ func GenerateRandomID() string {
 		// if we try to parse the truncated for as an int and we don't have
 		// 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
 		// an error then the value is all numberic and causes issues when
 		// used as a hostname. ref #3869
 		// 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
 			continue
 		}
 		}
 		return value
 		return value