[Bps-public-commit] email-address-list branch, master, updated. 0.05-2-g6a42da3

? sunnavy sunnavy at bestpractical.com
Thu Jun 4 10:25:16 EDT 2015


The branch, master has been updated
       via  6a42da3fac2b631c660b52bce8eaa2333a81b53c (commit)
       via  7c6cbeaa37d0ec7bdcfbb555efa5d4672d5e9544 (commit)
      from  a14af417ca4391c22593a99330033302034f803a (commit)

Summary of changes:
 lib/Email/Address/List.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 7c6cbeaa37d0ec7bdcfbb555efa5d4672d5e9544
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jun 4 22:04:33 2015 +0800

    it's more straightforward/clear to use atom and quoted-string to build phrase
    
    as rfc says:
    
        word            =       atom / quoted-string

diff --git a/lib/Email/Address/List.pm b/lib/Email/Address/List.pm
index ac79577..2e07c29 100644
--- a/lib/Email/Address/List.pm
+++ b/lib/Email/Address/List.pm
@@ -217,7 +217,7 @@ $RE{'quoted-string'}  = qr/$RE{'cfws'}*"$RE{'qcontent'}+"$RE{'cfws'}*/;
 
 $RE{'atom'}           = qr/$RE{'cfws'}*$RE{'atext'}++$RE{'cfws'}*/;
 
-$RE{'word'}           = qr/$RE{'cfws'}* (?: $RE{'atom'} | "$RE{'qcontent'}+" ) $RE{'cfws'}*/x;
+$RE{'word'}           = qr/$RE{'atom'} | $RE{'quoted-string'}/x;
 $RE{'phrase'}         = qr/$RE{'word'}+/x;
 $RE{'display-name'}   = $RE{'phrase'};
 

commit 6a42da3fac2b631c660b52bce8eaa2333a81b53c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jun 4 22:06:37 2015 +0800

    qcontent could be empty in quoted-string
    
    so "" is valid too.
    
    rfc says:
    
        quoted-string   =       [CFWS]
                            DQUOTE *([FWS] qcontent) [FWS] DQUOTE
                            [CFWS]

diff --git a/lib/Email/Address/List.pm b/lib/Email/Address/List.pm
index 2e07c29..d7eb274 100644
--- a/lib/Email/Address/List.pm
+++ b/lib/Email/Address/List.pm
@@ -213,7 +213,7 @@ for (1 .. $COMMENT_NEST_LEVEL) {
 $RE{'cfws'}           = qr/$RE{'comment'}|\s+/;
 
 $RE{'qcontent'}       = qr/$RE{'qtext'}|$RE{'quoted_pair'}/;
-$RE{'quoted-string'}  = qr/$RE{'cfws'}*"$RE{'qcontent'}+"$RE{'cfws'}*/;
+$RE{'quoted-string'}  = qr/$RE{'cfws'}*"$RE{'qcontent'}*"$RE{'cfws'}*/;
 
 $RE{'atom'}           = qr/$RE{'cfws'}*$RE{'atext'}++$RE{'cfws'}*/;
 

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list