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:20:57 UTC

Re: [2/2] git commit: [flex-sdk] - FLEX-24197 user name starting with a dot shoudl be invalid

Is "." the only first character that is illegal?  What about other
punctuation and symbols?  Or is it not worth checking for?


On 4/29/13 10:31 PM, "jmclean@apache.org" <jm...@apache.org> wrote:

> FLEX-24197 user name starting with a dot shoudl be 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/18b0dc3a
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/18b0dc3a
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/18b0dc3a
> 
> Branch: refs/heads/develop
> Commit: 18b0dc3ac77ef6b3fedbdcd25c78ed4abf0d9768
> Parents: bf540f6
> Author: Justin Mclean <jm...@apache.org>
> Authored: Tue Apr 30 15:30:56 2013 +1000
> Committer: Justin Mclean <jm...@apache.org>
> Committed: Tue Apr 30 15:30:56 2013 +1000
> 
> ----------------------------------------------------------------------
>  .../framework/src/mx/validators/EmailValidator.as  |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/18b0dc3a/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 9c864dd..f928371 100644
> --- a/frameworks/projects/framework/src/mx/validators/EmailValidator.as
> +++ b/frameworks/projects/framework/src/mx/validators/EmailValidator.as
> @@ -173,6 +173,15 @@ public class EmailValidator extends Validator
> }
> }
> 
> +  // name can't start with a dot
> +  if (username.charAt(0) == '.')
> +  {
> +   results.push(new ValidationResult(
> +    true, baseField, "invalidChar",
> +    validator.invalidCharError));
> +   return results;
> +  }
> +  
> var domainLen:int = domain.length;
> 
> // check for IP address
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: [2/2] git commit: [flex-sdk] - FLEX-24197 user name starting with a dot shoudl be invalid

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Is "." the only first character that is illegal?
As far as I know it the only char that's legal elsewhere but  not at the start.

Read  http://tools.ietf.org/html/rfc5322#section-3.4.1 and note that dot-atom-text is defined as  1*atext *("." 1*atext).

Thanks,
Justin