From: Rui Hirokawa Date: Sun, 12 Mar 2006 07:54:42 +0000 (+0000) Subject: MFH X-Git-Tag: php-5.1.3RC2~129 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e3ae2f5c201a461caaa5b1a4fbe37626c05ab42;p=php MFH --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index ed5f4bc8cf..06490d4dd4 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -687,6 +687,9 @@ static PHP_INI_MH(OnUpdate_mbstring_script_encoding) /* {{{ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) */ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) { + int c; + char *endptr = NULL; + if (new_value != NULL) { if (strcasecmp("none", new_value) == 0) { MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE; @@ -694,7 +697,12 @@ static PHP_INI_MH(OnUpdate_mbstring_substitute_character) MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG; } else { MBSTRG(filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR; - MBSTRG(filter_illegal_substchar) = zend_atoi(new_value, new_value_length); + if (new_value_length >0) { + c = strtol(new_value, &endptr, 0); + if (*endptr == '\0') { + MBSTRG(filter_illegal_substchar) = c; + } + } } }