summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-11-19 19:27:12 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-11-19 19:27:12 +0100
commit38b80aaf8574a5297e01d9a7ade5baf1637401d7 (patch)
tree3567fc869a26eb711fc7af8091f89d138c46fb42 /win32
parentdc8fb9dc8b7c0a2e68f629e02b5e55b23f4e00ee (diff)
parentc7343510e40c57b14111195e14bb31df3527db3f (diff)
downloadphp-git-38b80aaf8574a5297e01d9a7ade5baf1637401d7.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: Fix #72964: White space not unfolded for CC/Bcc headers
Diffstat (limited to 'win32')
-rw-r--r--win32/sendmail.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c
index 3d73ef9b5b..059bc946ee 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -459,6 +459,16 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, char *
if (NULL == (pos2 = strstr(pos1, "\r\n"))) {
tempMailTo = estrndup(pos1, strlen(pos1));
} else {
+ char *pos3;
+ while (pos2[2] == ' ' || pos2[2] == '\t') {
+ pos3 = strstr(pos2 + 2, "\r\n");
+ if (pos3 != NULL) {
+ pos2 = pos3;
+ } else {
+ pos2 += strlen(pos2);
+ break;
+ }
+ }
tempMailTo = estrndup(pos1, pos2 - pos1);
}
@@ -517,7 +527,22 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, char *
header we know it was the last thing. */
pos2 = pos1;
} else {
+ char *pos3 = NULL;
+ while (pos2[2] == ' ' || pos2[2] == '\t') {
+ pos3 = strstr(pos2 + 2, "\r\n");
+ if (pos3 != NULL) {
+ pos2 = pos3;
+ } else {
+ pos2 += strlen(pos2);
+ break;
+ }
+ }
tempMailTo = estrndup(pos1, pos2 - pos1);
+ if (pos3 == NULL) {
+ /* Later, when we remove the Bcc: out of the
+ header we know it was the last thing. */
+ pos2 = pos1;
+ }
}
token = strtok(tempMailTo, ",");