dmd2.068.0 size_t defined as (from http://dlang.org/type.html): "size_t is an alias to one of the unsigned integral basic types" (i.e. size_t is unsigned) Both uriLength and emailLength return size_t. ...but are supposed to return -1 if invalid Cannot use a test that uses "< 0". Additionaly, dmd does not issue any warning when performing this test.
https://github.com/D-Programming-Language/phobos/pull/3558 By the way, the ddoc for emailLength/uriLength would need to be revised a bit, wouldn't they ?
Another aspect that should be noted in the documentation is that only a _very_ narrow subset of URI's are accepted.... try ftp:///foo.com (valid URI, fails 'test').....!
It looks like std.uri hasn't changed since it's been added in 2007. If you look at the implementation it's really old fashioned D. For example nowadays, for `emailLength()` and `uriLength()`, the parameter would not be of type `in char[]` but at least `string` and even perahps an InputRange with a constraint of type `if (isInputRange!T && isSomeChar!T)`... I wouldn't be surprised if someone from the organisation would come and say that's it's deprecated and that instead a Regex can be used. I hang on Dlang only still one or two years so I can't say more...I may be wrong.
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/169101f7bf64c2f394c39a2ba297eabd2220ecf5 fix issue 14924 https://github.com/D-Programming-Language/phobos/commit/d697e0fd4f0bcd692b0d5fedaf9baede75f8984b added unittests for issue 14924 https://github.com/D-Programming-Language/phobos/commit/3241856fe4c84f7ae4bfb075b06aa27bb878891a Merge pull request #3558 from BBasile/BBasile-patch-issue14924 fix issue14924
Commits pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/169101f7bf64c2f394c39a2ba297eabd2220ecf5 fix issue 14924 https://github.com/D-Programming-Language/phobos/commit/d697e0fd4f0bcd692b0d5fedaf9baede75f8984b added unittests for issue 14924 https://github.com/D-Programming-Language/phobos/commit/3241856fe4c84f7ae4bfb075b06aa27bb878891a Merge pull request #3558 from BBasile/BBasile-patch-issue14924