File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -3187,21 +3187,25 @@ PHP_FUNCTION(imap_fetch_overview)
3187
3187
}
3188
3188
/* }}} */
3189
3189
3190
- static bool header_injection (zend_string * str , bool adrlist )
3190
+ static bool header_injection (const zend_string * str , bool adrlist )
3191
3191
{
3192
- char * p = ZSTR_VAL (str );
3192
+ const char * p = ZSTR_VAL (str );
3193
3193
3194
3194
while ((p = strpbrk (p , "\r\n" )) != NULL ) {
3195
- if (!(p [0 ] == '\r' && p [1 ] == '\n' )
3196
- /* adrlists do not support folding, but swallow trailing line breaks */
3197
- && !((adrlist && p [1 ] == '\0' )
3198
- /* other headers support folding */
3199
- || (!adrlist && (p [1 ] == ' ' || p [1 ] == '\t' )))) {
3200
- return 1 ;
3195
+ if (
3196
+ !(p [0 ] == '\r' && p [1 ] == '\n' )
3197
+ /* adrlists do not support folding, but swallow trailing line breaks */
3198
+ && !(
3199
+ (adrlist && p [1 ] == '\0' )
3200
+ /* other headers support folding */
3201
+ || (!adrlist && (p [1 ] == ' ' || p [1 ] == '\t' ))
3202
+ )
3203
+ ) {
3204
+ return true;
3201
3205
}
3202
3206
p ++ ;
3203
3207
}
3204
- return 0 ;
3208
+ return false ;
3205
3209
}
3206
3210
3207
3211
/* {{{ Create a MIME message based on given envelope and body sections */
You can’t perform that action at this time.
0 commit comments