hirokawa Fri Nov 3 02:24:50 2006 UTC Modified files: (Branch: PHP_4_4) /php-src/ext/mbstring mbstring.c Log: fixed illegal encoding detection when mbstring.encoding_translation is enabled.(made by komura) http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.142.2.47.2.17&r2=1.142.2.47.2.18&diff_format=u Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.142.2.47.2.17 php-src/ext/mbstring/mbstring.c:1.142.2.47.2.18 --- php-src/ext/mbstring/mbstring.c:1.142.2.47.2.17 Mon Apr 3 13:04:13 2006 +++ php-src/ext/mbstring/mbstring.c Fri Nov 3 02:24:50 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mbstring.c,v 1.142.2.47.2.17 2006/04/03 13:04:13 masugata Exp $ */ +/* $Id: mbstring.c,v 1.142.2.47.2.18 2006/11/03 02:24:50 hirokawa Exp $ */ /* * PHP4 Multibyte String module "mbstring" @@ -1013,7 +1013,10 @@ MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding); MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode); MBSTRG(current_filter_illegal_substchar) = MBSTRG(filter_illegal_substchar); - MBSTRG(illegalchars) = 0; + + if (!MBSTRG(encoding_translation)) { + MBSTRG(illegalchars) = 0; + } n = 0; if (MBSTRG(detect_order_list)) { @@ -1774,6 +1777,8 @@ info.num_from_encodings = MBSTRG(http_input_list_size); info.from_language = MBSTRG(language); + MBSTRG(illegalchars) = 0; + detected = php_mbstr_encoding_handler(&info, array_ptr, res TSRMLS_CC); MBSTRG(http_input_identify) = detected; @@ -3864,8 +3869,13 @@ if (ret != NULL) { MBSTRG(illegalchars) += illegalchars; - efree(ret->val); - RETURN_BOOL(illegalchars == 0); + if (illegalchars == 0 && strncmp(string.val, ret->val, string.len) == 0) { + efree(ret->val); + RETURN_TRUE; + } else { + efree(ret->val); + RETURN_FALSE; + } } else { RETURN_FALSE; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php