mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix legacy text conversion filter for UTF7-IMAP
Make necessary updates to filter state before using CK macro.
This commit is contained in:
parent
0a6ea5bd4e
commit
219fff376b
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue