chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use email_valid() to check email addresses throughout
[disorder]
/
cgi
/
actions.c
diff --git
a/cgi/actions.c
b/cgi/actions.c
index 8bbce8787a97642a087c2900f73f5843917a2863..4d064e0fb8e86c8ae6a44e0360b0992eed8165e3 100644
(file)
--- a/
cgi/actions.c
+++ b/
cgi/actions.c
@@
-434,9
+434,8
@@
static void act_register(void) {
return;
}
/* We could well do better address validation but for now we'll just do the
return;
}
/* We could well do better address validation but for now we'll just do the
- * minimum
- /* TODO use email_valid() */
- if(!strchr(email, '@')) {
+ * minimum */
+ if(!email_valid(email)) {
login_error("bademail");
return;
}
login_error("bademail");
return;
}
@@
-525,8
+524,7
@@
static void act_edituser(void) {
}
} else
password = password2 = 0;
}
} else
password = password2 = 0;
- /* TODO use email_valid() */
- if(email && !strchr(email, '@')) {
+ if(email && !email_valid(email)) {
login_error("bademail");
return;
}
login_error("bademail");
return;
}
@@
-745,7
+743,7
@@
void dcgi_expand(const char *name, int header) {
if(!(found = mx_find(p, 0/*report*/)))
fatal(errno, "cannot find %s", p);
if(header) {
if(!(found = mx_find(p, 0/*report*/)))
fatal(errno, "cannot find %s", p);
if(header) {
- if(printf("Content-Type: text/html\n"
+ if(printf("Content-Type: text/html
; charset=UTF-8
\n"
"%s\n"
"\n", dcgi_cookie_header()) < 0)
fatal(errno, "error writing to stdout");
"%s\n"
"\n", dcgi_cookie_header()) < 0)
fatal(errno, "error writing to stdout");