mirror of
https://github.com/php/php-src.git
synced 2026-03-25 00:32:23 +01:00
Fix legacy text conversion filter for UTF7-IMAP
Make necessary updates to filter state before using CK macro.
This commit is contained in:
@@ -140,16 +140,18 @@ int mbfl_filt_conv_utf7imap_wchar(int c, mbfl_convert_filter *filter)
|
||||
if (n < 0 || n > 63) {
|
||||
if (c == '-') {
|
||||
if (filter->status == 1) { /* "&-" -> "&" */
|
||||
filter->cache = filter->status = 0;
|
||||
CK((*filter->output_function)('&', filter->data));
|
||||
} else if (filter->cache) {
|
||||
/* Base64-encoded section ended abruptly, with partially encoded characters,
|
||||
* or it could be that it ended on the first half of a surrogate pair */
|
||||
filter->cache = filter->status = 0;
|
||||
CK((*filter->output_function)(MBFL_BAD_INPUT, filter->data));
|
||||
}
|
||||
} else { /* illegal character */
|
||||
filter->cache = filter->status = 0;
|
||||
CK((*filter->output_function)(MBFL_BAD_INPUT, filter->data));
|
||||
}
|
||||
filter->cache = filter->status = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user