]> granicus.if.org Git - php/commitdiff
MFH
authorRui Hirokawa <hirokawa@php.net>
Sun, 12 Mar 2006 07:54:56 +0000 (07:54 +0000)
committerRui Hirokawa <hirokawa@php.net>
Sun, 12 Mar 2006 07:54:56 +0000 (07:54 +0000)
ext/mbstring/mbstring.c

index 0541b84357e667d90bfadeff1e2733210ff31bce..3602bc38bcc7d7b14132ef732f50889d3639f962 100644 (file)
@@ -757,6 +757,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;
@@ -764,7 +767,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;
+                               }
+                       }
                }
        }