You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2013/04/30 18:22:01 UTC
Re: [1/2] git commit: [flex-sdk] - FLEX-23614 fix so that 1.1..1 or
similar is invalid
Is it worth checking for other weird crap that Number converts to 0 like
"false" and "null" and I think other whitespace?
On 4/29/13 10:31 PM, "jmclean@apache.org" <jm...@apache.org> wrote:
> Updated Branches:
> refs/heads/develop 32aa4a226 -> 18b0dc3ac
>
>
> FLEX-23614 fix so that 1.1..1 or similar is invalid
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/bf540f6c
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/bf540f6c
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/bf540f6c
>
> Branch: refs/heads/develop
> Commit: bf540f6cd5ab49ec3d41536e9d4f4415399b1f35
> Parents: 32aa4a2
> Author: Justin Mclean <jm...@apache.org>
> Authored: Tue Apr 30 15:10:10 2013 +1000
> Committer: Justin Mclean <jm...@apache.org>
> Committed: Tue Apr 30 15:10:10 2013 +1000
>
> ----------------------------------------------------------------------
> .../framework/src/mx/validators/EmailValidator.as | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bf540f6c/frameworks/proje
> cts/framework/src/mx/validators/EmailValidator.as
> ----------------------------------------------------------------------
> diff --git a/frameworks/projects/framework/src/mx/validators/EmailValidator.as
> b/frameworks/projects/framework/src/mx/validators/EmailValidator.as
> index 5217fa2..9c864dd 100644
> --- a/frameworks/projects/framework/src/mx/validators/EmailValidator.as
> +++ b/frameworks/projects/framework/src/mx/validators/EmailValidator.as
> @@ -346,7 +346,7 @@ public class EmailValidator extends Validator
> {
> item = parseInt(ipArray[i], 16);
>
> - if (isNaN(item) || item < 0 || item > 0xFFFF)
> + if (isNaN(item) || item < 0 || item > 0xFFFF || ipArray[i] == "")
> return false;
> }
> }
> @@ -381,7 +381,7 @@ public class EmailValidator extends Validator
> for (i = 0; i < n; i++)
> {
> item = Number(ipArray[i]);
> - if (isNaN(item) || item < 0 || item > 255)
> + if (isNaN(item) || item < 0 || item > 255 || ipArray[i] == "")
> return false;
> }
>
>
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui
Re: [1/2] git commit: [flex-sdk] - FLEX-23614 fix so that 1.1..1 or similar is invalid
Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,
> Is it worth checking for other weird crap that Number converts to 0 like
> "false" and "null" and I think other whitespace?
Probably I think " " and "\t" would currently count as valid (when they are not). What it probably really do is check each digit is actually a digit.
Thanks,
Justin