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)) {
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;
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;
}