mirror of
https://github.com/php/php-src.git
synced 2024-12-04 23:34:25 +08:00
Fixed bug #52599 (iconv output handler outputs incorrect content type when flags are used).
This commit is contained in:
parent
0b1477a716
commit
06c460c995
2
NEWS
2
NEWS
@ -16,6 +16,8 @@
|
||||
- Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
|
||||
(Kalle, rein at basefarm dot no)
|
||||
- Fixed bug #52613 (crash in mysqlnd after hitting memory limit). (Andrey)
|
||||
- Fixed bug #52599 (iconv output handler outputs incorrect content type
|
||||
when flags are used). (Ilia)
|
||||
- Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe)
|
||||
- Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values).
|
||||
(Felipe)
|
||||
|
@ -2340,7 +2340,13 @@ PHP_FUNCTION(ob_iconv_handler)
|
||||
ICONVG(output_encoding), ICONVG(internal_encoding));
|
||||
_php_iconv_show_error(err, ICONVG(output_encoding), ICONVG(internal_encoding) TSRMLS_CC);
|
||||
if (out_buffer != NULL) {
|
||||
int len = spprintf(&content_type, 0, "Content-Type:%s; charset=%s", mimetype, ICONVG(output_encoding));
|
||||
int len;
|
||||
char *p = strstr(ICONVG(output_encoding), "//");
|
||||
if (p) {
|
||||
len = spprintf(&content_type, 0, "Content-Type:%s; charset=%.*s", mimetype, (int)(p - ICONVG(output_encoding)), ICONVG(output_encoding));
|
||||
} else {
|
||||
len = spprintf(&content_type, 0, "Content-Type:%s; charset=%s", mimetype, ICONVG(output_encoding));
|
||||
}
|
||||
if (content_type && sapi_add_header(content_type, len, 0) != FAILURE) {
|
||||
SG(sapi_headers).send_default_content_type = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user