Fossil SCM

Allow + signs in email addresses. Added a comment to link to a source giving the true limit on legal characters in email addresses, which are currently far less restrictive than our newly-expanded limits.

wyoung 2018-08-17 01:27 trunk
Commit 1bfd790352f944f131805e938251c5477b9202801be54a08f81fdeecb11f6f49
1 file changed +6 -2
+6 -2
--- src/email.c
+++ src/email.c
@@ -1153,21 +1153,25 @@
11531153
*pzErr = 0;
11541154
11551155
/* Check the validity of the email address.
11561156
**
11571157
** (1) Exactly one '@' character.
1158
- ** (2) No other characters besides [a-zA-Z0-9._-]
1158
+ ** (2) No other characters besides [a-zA-Z0-9._+-]
1159
+ **
1160
+ ** The local part is currently more restrictive than RFC 5322 allows:
1161
+ ** https://stackoverflow.com/a/2049510/142454 We will expand this as
1162
+ ** necessary.
11591163
*/
11601164
zEAddr = P("e");
11611165
if( zEAddr==0 ) return 0;
11621166
for(i=j=n=0; (c = zEAddr[i])!=0; i++){
11631167
if( c=='@' ){
11641168
n = i;
11651169
j++;
11661170
continue;
11671171
}
1168
- if( !fossil_isalnum(c) && c!='.' && c!='_' && c!='-' ){
1172
+ if( !fossil_isalnum(c) && c!='.' && c!='_' && c!='-' && c!='+' ){
11691173
*peErr = 1;
11701174
*pzErr = mprintf("illegal character in email address: 0x%x '%c'",
11711175
c, c);
11721176
return 0;
11731177
}
11741178
--- src/email.c
+++ src/email.c
@@ -1153,21 +1153,25 @@
1153 *pzErr = 0;
1154
1155 /* Check the validity of the email address.
1156 **
1157 ** (1) Exactly one '@' character.
1158 ** (2) No other characters besides [a-zA-Z0-9._-]
 
 
 
 
1159 */
1160 zEAddr = P("e");
1161 if( zEAddr==0 ) return 0;
1162 for(i=j=n=0; (c = zEAddr[i])!=0; i++){
1163 if( c=='@' ){
1164 n = i;
1165 j++;
1166 continue;
1167 }
1168 if( !fossil_isalnum(c) && c!='.' && c!='_' && c!='-' ){
1169 *peErr = 1;
1170 *pzErr = mprintf("illegal character in email address: 0x%x '%c'",
1171 c, c);
1172 return 0;
1173 }
1174
--- src/email.c
+++ src/email.c
@@ -1153,21 +1153,25 @@
1153 *pzErr = 0;
1154
1155 /* Check the validity of the email address.
1156 **
1157 ** (1) Exactly one '@' character.
1158 ** (2) No other characters besides [a-zA-Z0-9._+-]
1159 **
1160 ** The local part is currently more restrictive than RFC 5322 allows:
1161 ** https://stackoverflow.com/a/2049510/142454 We will expand this as
1162 ** necessary.
1163 */
1164 zEAddr = P("e");
1165 if( zEAddr==0 ) return 0;
1166 for(i=j=n=0; (c = zEAddr[i])!=0; i++){
1167 if( c=='@' ){
1168 n = i;
1169 j++;
1170 continue;
1171 }
1172 if( !fossil_isalnum(c) && c!='.' && c!='_' && c!='-' && c!='+' ){
1173 *peErr = 1;
1174 *pzErr = mprintf("illegal character in email address: 0x%x '%c'",
1175 c, c);
1176 return 0;
1177 }
1178

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button