@@ -3253,16 +3253,6 @@ PHP_FUNCTION(mb_decode_numericentity)
3253
3253
/* }}} */
3254
3254
3255
3255
/* {{{ Sends an email message with MIME scheme */
3256
-
3257
- #define SKIP_LONG_HEADER_SEP_MBSTRING (str , pos ) \
3258
- if (str[pos] == '\r' && str[pos + 1] == '\n' && (str[pos + 2] == ' ' || str[pos + 2] == '\t')) { \
3259
- pos += 2; \
3260
- while (str[pos + 1] == ' ' || str[pos + 1] == '\t') { \
3261
- pos++; \
3262
- } \
3263
- continue; \
3264
- }
3265
-
3266
3256
static int _php_mbstr_parse_mail_headers (HashTable * ht , const char * str , size_t str_len )
3267
3257
{
3268
3258
const char * ps ;
@@ -3567,15 +3557,20 @@ PHP_FUNCTION(mb_send_mail)
3567
3557
to_r [to_len - 1 ] = '\0' ;
3568
3558
}
3569
3559
for (i = 0 ; to_r [i ]; i ++ ) {
3570
- if (iscntrl ((unsigned char ) to_r [i ])) {
3571
- /* According to RFC 822, section 3.1.1 long headers may be separated into
3572
- * parts using CRLF followed at least one linear-white-space character ('\t' or ' ').
3573
- * To prevent these separators from being replaced with a space, we use the
3574
- * SKIP_LONG_HEADER_SEP_MBSTRING to skip over them.
3575
- */
3576
- SKIP_LONG_HEADER_SEP_MBSTRING (to_r , i );
3577
- to_r [i ] = ' ' ;
3578
- }
3560
+ if (iscntrl ((unsigned char ) to_r [i ])) {
3561
+ /* According to RFC 822, section 3.1.1 long headers may be separated into
3562
+ * parts using CRLF followed at least one linear-white-space character ('\t' or ' ').
3563
+ * To prevent these separators from being replaced with a space, we skip over them. */
3564
+ if (to_r [i ] == '\r' && to_r [i + 1 ] == '\n' && (to_r [i + 2 ] == ' ' || to_r [i + 2 ] == '\t' )) {
3565
+ i += 2 ;
3566
+ while (to_r [i + 1 ] == ' ' || to_r [i + 1 ] == '\t' ) {
3567
+ i ++ ;
3568
+ }
3569
+ continue ;
3570
+ }
3571
+
3572
+ to_r [i ] = ' ' ;
3573
+ }
3579
3574
}
3580
3575
} else {
3581
3576
to_r = to ;
@@ -3694,7 +3689,6 @@ PHP_FUNCTION(mb_send_mail)
3694
3689
}
3695
3690
}
3696
3691
3697
- #undef SKIP_LONG_HEADER_SEP_MBSTRING
3698
3692
#undef MAIL_ASCIIZ_CHECK_MBSTRING
3699
3693
#undef PHP_MBSTR_MAIL_MIME_HEADER1
3700
3694
#undef PHP_MBSTR_MAIL_MIME_HEADER2
0 commit comments