This is a long shot, I could not really reproduce #19999, but adding some changes that might help.
- when checking for string length, make sure to treat the values as strings
- relax comparisons, if for some reason the versions were parsed as numbers/strings the comparisons should not fail, i.e. in our case "2" and 2 is still the same.
implements #19999