All right so i’m dealing a bit with excel and i’m seeing that we’re dealing with numbers and datetimes in a weird way.
If you’ll notice, the number and the datetime are being used as hyperlinks. It also has some formula implications because when cells contain hyperlinks, they’re not numbers. So you get some confusions from the spreadsheet software and it claims it can’t add a sum of URLs:
After a brief exploration, i believe the issue that’s causing this is the validator’s GetUrl function. When you send either a number or a datetime through RS.Stl.Validation.Validator.GetUrl, that code relies on either Uri creation to fail, or for it to fail to match a small set of formatting criteria.
I suggest that we alter the GetUrl method to do one or two things to tighten it up and reject more invalid URLs.
First, we could use Uri.IsWellFormedUriString just before Uri creation to reject strings that don’t look like URIs (to .net). I tested this and it successfully rejected the datetime i entered in. It failed to reject the numerical value.
Second, (and i’m less solid on this), i think we should reject urls that successfully pass validation as numbers (ints, bytes, decimals, floats, etc). I don’t think there are any solely numerical TLDs, are there? If there were, there’s the possibility that 123.456 could pass as a website, but if there aren’t any, then that just leaves IP schemes that could get confused with numbers, which i don’t think should be a problem.
These two bits solved my problem. What do y’all think?