summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2002-07-27 13:58:16 +0000
committerRui Hirokawa <hirokawa@php.net>2002-07-27 13:58:16 +0000
commitfbbeaec63038ec44cc2cebe4726019dec245e259 (patch)
treedcd48fc395ed56810301ef70a9217f19a0345ebc /main/SAPI.c
parent70d71846249b7d4172ea4275d2e371b6f321edb9 (diff)
downloadphp-git-fbbeaec63038ec44cc2cebe4726019dec245e259.tar.gz
fixed: output encoding translation by mb_output_handler() in ext/mbstring was not usable when Content-Type is set by header().
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 1aa931db60..8f53ff8539 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -490,6 +490,10 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC)
}
mimetype = estrdup(ptr);
newlen = sapi_apply_default_charset(&mimetype, len TSRMLS_CC);
+ if (!SG(sapi_headers).mimetype){
+ SG(sapi_headers).mimetype = estrdup(mimetype);
+ }
+
if (newlen != 0) {
newlen += sizeof("Content-type: ");
newheader = emalloc(newlen);
@@ -677,6 +681,9 @@ SAPI_API int sapi_send_headers(TSRMLS_D)
if (SG(sapi_headers).http_status_line) {
efree(SG(sapi_headers).http_status_line);
}
+ if (SG(sapi_headers).mimetype) {
+ efree(SG(sapi_headers).mimetype);
+ }
return ret;
}