summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2002-11-13 08:26:04 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2002-11-13 08:26:04 +0000
commit7addde8521ba8436cecc15bd61a78c76ebc13382 (patch)
treedb629f1997d39927bdb9cca7fcb2580fae27b781 /ext
parent2a8fa04b1872ec79b2281da754f0e1bc2aa1dfcd (diff)
downloadphp-git-7addde8521ba8436cecc15bd61a78c76ebc13382.tar.gz
Prevented unwanted encoding detections in mb_send_mail()
# This patch shouldn't break BC
Diffstat (limited to 'ext')
-rw-r--r--ext/mbstring/mbstring.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 29d9489a9c..30fb0650ff 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -3344,9 +3344,10 @@ PHP_FUNCTION(mb_send_mail)
orig_str.no_language = MBSTRG(current_language);
orig_str.val = (unsigned char *)Z_STRVAL_PP(argv[1]);
orig_str.len = Z_STRLEN_PP(argv[1]);
- orig_str.no_encoding = mbfl_identify_encoding_no(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size) TSRMLS_CC);
- if (orig_str.no_encoding == mbfl_no_encoding_invalid) {
- orig_str.no_encoding = MBSTRG(current_internal_encoding);
+ orig_str.no_encoding = MBSTRG(current_internal_encoding);
+ if (orig_str.no_encoding == mbfl_no_encoding_invalid
+ || orig_str.no_encoding == mbfl_no_encoding_pass) {
+ orig_str.no_encoding = mbfl_identify_encoding_no(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size) TSRMLS_CC);
}
pstr = mbfl_mime_header_encode(&orig_str, &conv_str, tran_cs, head_enc, "\n", sizeof("Subject: [PHP-jp nnnnnnnn]") TSRMLS_CC);
if (pstr != NULL) {
@@ -3365,9 +3366,11 @@ PHP_FUNCTION(mb_send_mail)
orig_str.no_language = MBSTRG(current_language);
orig_str.val = Z_STRVAL_PP(argv[2]);
orig_str.len = Z_STRLEN_PP(argv[2]);
- orig_str.no_encoding = mbfl_identify_encoding_no(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size) TSRMLS_CC);
- if (orig_str.no_encoding == mbfl_no_encoding_invalid) {
- orig_str.no_encoding = MBSTRG(current_internal_encoding);
+ orig_str.no_encoding = MBSTRG(current_internal_encoding);
+
+ if (orig_str.no_encoding == mbfl_no_encoding_invalid
+ || orig_str.no_encoding == mbfl_no_encoding_pass) {
+ orig_str.no_encoding = mbfl_identify_encoding_no(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size) TSRMLS_CC);
}
pstr = mbfl_convert_encoding(&orig_str, &conv_str, tran_cs TSRMLS_CC);
if (pstr != NULL) {