moriyoshi               Sat Aug  2 20:49:48 2008 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/ext/mbstring       mbstring.c mbstring.h 
  Log:
  - MFH: Fixed bug #45691 (Some per-dir or runtime settings may leak into other 
requests).
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1186&r2=1.2027.2.547.2.1187&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1186 php-src/NEWS:1.2027.2.547.2.1187
--- php-src/NEWS:1.2027.2.547.2.1186    Fri Aug  1 22:58:17 2008
+++ php-src/NEWS        Sat Aug  2 20:49:47 2008
@@ -14,6 +14,8 @@
 - Fixed a regression when using strip_tags() and < is within an attribute.
   (Scott)
 
+- Fixed bug #45691 (Some per-dir or runtime settings may leak into other
+  requests). (Moriyoshi)
 - Fixed bug #45568 (ISAPI doesn't properly clear auth_digest in header).
   (Patch by: navara at emclient dot com)
 - Fixed bug #45556 (Return value from callback isn't freed). (Felipe)
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.34&r2=1.224.2.22.2.35&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.34 
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.35
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.34     Fri Aug  1 22:53:20 2008
+++ php-src/ext/mbstring/mbstring.c     Sat Aug  2 20:49:47 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mbstring.c,v 1.224.2.22.2.34 2008/08/01 22:53:20 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.35 2008/08/02 20:49:47 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring"
@@ -89,7 +89,7 @@
 /* {{{ php_mb_default_identify_list */
 typedef struct _php_mb_nls_ident_list {
        enum mbfl_no_language lang;
-       enum mbfl_no_encoding* list;
+       const enum mbfl_no_encoding* list;
        int list_size;
 } php_mb_nls_ident_list;
 
@@ -560,7 +560,7 @@
 
        for (i = 0; i < sizeof(php_mb_default_identify_list) / 
sizeof(php_mb_default_identify_list[0]); i++) {
                if (php_mb_default_identify_list[i].lang == lang) {
-                       *plist = php_mb_default_identify_list[i].list;
+                       *plist = (enum mbfl_no_encoding 
*)php_mb_default_identify_list[i].list;
                        *plist_size = php_mb_default_identify_list[i].list_size;
                        return 1;
                }
@@ -576,6 +576,7 @@
 
        no_language = mbfl_name2no_language(new_value);
        if (no_language == mbfl_no_language_invalid) {
+               MBSTRG(language) = mbfl_no_language_neutral;
                return FAILURE;
        }
        MBSTRG(language) = no_language;
@@ -591,12 +592,16 @@
        int size;
 
        if (php_mb_parse_encoding_list(new_value, new_value_length, &list, 
&size, 1 TSRMLS_CC)) {
-               if (MBSTRG(detect_order_list) != NULL) {
+               if (MBSTRG(detect_order_list)) {
                        free(MBSTRG(detect_order_list));
                }
                MBSTRG(detect_order_list) = list;
                MBSTRG(detect_order_list_size) = size;
        } else {
+               if (MBSTRG(detect_order_list)) {
+                       free(MBSTRG(detect_order_list));
+                       MBSTRG(detect_order_list) = NULL;
+               }
                return FAILURE;
        }
 
@@ -611,12 +616,17 @@
        int size;
 
        if (php_mb_parse_encoding_list(new_value, new_value_length, &list, 
&size, 1 TSRMLS_CC)) {
-               if (MBSTRG(http_input_list) != NULL) {
+               if (MBSTRG(http_input_list)) {
                        free(MBSTRG(http_input_list));
                }
                MBSTRG(http_input_list) = list;
                MBSTRG(http_input_list_size) = size;
        } else {
+               if (MBSTRG(http_input_list)) {
+                       free(MBSTRG(http_input_list));
+                       MBSTRG(http_input_list) = NULL;
+               }
+               MBSTRG(http_input_list_size) = 0;
                return FAILURE;
        }
 
@@ -634,6 +644,8 @@
                MBSTRG(http_output_encoding) = no_encoding;
                MBSTRG(current_http_output_encoding) = no_encoding;
        } else {
+               MBSTRG(http_output_encoding) = mbfl_no_encoding_pass;
+               MBSTRG(current_http_output_encoding) = mbfl_no_encoding_pass;
                if (new_value != NULL && new_value_length > 0) {
                        return FAILURE;
                }
@@ -647,32 +659,74 @@
 static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
 {
        enum mbfl_no_encoding no_encoding;
-       if (new_value == NULL) {
-               return SUCCESS;
-       }
+       const char *enc_name = NULL;
+       uint enc_name_len = 0;
 
-       no_encoding = mbfl_name2no_encoding(new_value);
+       no_encoding = new_value ? mbfl_name2no_encoding(new_value):
+                               mbfl_no_encoding_invalid;
        if (no_encoding != mbfl_no_encoding_invalid) {
-               MBSTRG(internal_encoding) = no_encoding;
-               MBSTRG(current_internal_encoding) = no_encoding;
+               enc_name = new_value;
+               enc_name_len = new_value_length;
+       } else {
+               switch (MBSTRG(language)) {
+                       case mbfl_no_language_uni:
+                               enc_name = "UTF-8";
+                               enc_name_len = sizeof("UTF-8") - 1;
+                               break;
+                       case mbfl_no_language_japanese:
+                               enc_name = "EUC-JP";
+                               enc_name_len = sizeof("EUC-JP") - 1;
+                               break;
+                       case mbfl_no_language_korean:
+                               enc_name = "EUC-KR";
+                               enc_name_len = sizeof("EUC-KR") - 1;
+                               break;
+                       case mbfl_no_language_simplified_chinese:
+                               enc_name = "EUC-CN";
+                               enc_name_len = sizeof("EUC-CN") - 1;
+                               break;
+                       case mbfl_no_language_traditional_chinese:
+                               enc_name = "EUC-TW";
+                               enc_name_len = sizeof("EUC-TW") - 1;
+                               break;
+                       case mbfl_no_language_russian:
+                               enc_name = "KOI8-R";
+                               enc_name_len = sizeof("KOI8-R") - 1;
+                               break;
+                       case mbfl_no_language_german:
+                               enc_name = "ISO-8859-15";
+                               enc_name_len = sizeof("ISO-8859-15") - 1;
+                               break;
+                       case mbfl_no_language_armenian:
+                               enc_name = "ArmSCII-8";
+                               enc_name_len = sizeof("ArmSCII-8") - 1;
+                               break;
+                       case mbfl_no_language_turkish:
+                               enc_name = "ISO-8859-9";
+                               enc_name_len = sizeof("ISO-8859-9") - 1;
+                               break;
+                       default:
+                               enc_name = "ISO-8859-1";
+                               enc_name_len = sizeof("ISO-8859-1") - 1;
+                               break;
+               }
+               no_encoding = mbfl_name2no_encoding(enc_name);
+       }
+       MBSTRG(internal_encoding) = no_encoding;
+       MBSTRG(current_internal_encoding) = no_encoding;
 #if HAVE_MBREGEX
-               {
-                       OnigEncoding mbctype;
-                       mbctype = php_mb_regex_name2mbctype(new_value);
-                       if (mbctype == ONIG_ENCODING_UNDEF) {
-                               mbctype = ONIG_ENCODING_EUC_JP;
-                       }
-                       MBSTRG(current_mbctype) = MBSTRG(default_mbctype) = 
mbctype;
+       {
+               OnigEncoding mbctype;
+               mbctype = php_mb_regex_name2mbctype(enc_name);
+               if (mbctype == ONIG_ENCODING_UNDEF) {
+                       mbctype = ONIG_ENCODING_EUC_JP;
                }
+               MBSTRG(current_mbctype) = MBSTRG(default_mbctype) = mbctype;
+       }
 #endif
 #ifdef ZEND_MULTIBYTE
-               zend_multibyte_set_internal_encoding(new_value, 
new_value_length TSRMLS_CC);
+       zend_multibyte_set_internal_encoding((char *)enc_name, enc_name_len 
TSRMLS_CC);
 #endif /* ZEND_MULTIBYTE */
-       } else {
-               if (new_value != NULL && new_value_length > 0) {
-                       return FAILURE;
-               }
-       }
 
        return SUCCESS;
 }
@@ -691,6 +745,11 @@
                MBSTRG(script_encoding_list) = list;
                MBSTRG(script_encoding_list_size) = size;
        } else {
+               if (MBSTRG(script_encoding_list) != NULL) {
+                       free(MBSTRG(script_encoding_list));
+               }
+               MBSTRG(script_encoding_list) = NULL;
+               MBSTRG(script_encoding_list_size) = 0;
                return FAILURE;
        }
 
@@ -756,7 +815,7 @@
 
 /* {{{ php.ini directive registration */
 PHP_INI_BEGIN()
-        PHP_INI_ENTRY("mbstring.language", "neutral", PHP_INI_SYSTEM | 
PHP_INI_PERDIR, OnUpdate_mbstring_language)
+        PHP_INI_ENTRY("mbstring.language", "neutral", PHP_INI_ALL, 
OnUpdate_mbstring_language)
         PHP_INI_ENTRY("mbstring.detect_order", NULL, PHP_INI_ALL, 
OnUpdate_mbstring_detect_order)
         PHP_INI_ENTRY("mbstring.http_input", "pass", PHP_INI_ALL, 
OnUpdate_mbstring_http_input)
         PHP_INI_ENTRY("mbstring.http_output", "pass", PHP_INI_ALL, 
OnUpdate_mbstring_http_output)
@@ -781,7 +840,6 @@
 static PHP_GINIT_FUNCTION(mbstring)
 {
        mbstring_globals->language = mbfl_no_language_uni;
-       mbstring_globals->current_language = mbstring_globals->language;
        mbstring_globals->internal_encoding = mbfl_no_encoding_invalid;
        mbstring_globals->current_internal_encoding = 
mbstring_globals->internal_encoding;
 #ifdef ZEND_MULTIBYTE
@@ -887,53 +945,9 @@
        zend_function *func, *orig;
        const struct mb_overload_def *p;
 
-       MBSTRG(current_language) = MBSTRG(language);
        php_mb_nls_get_default_detect_order_list(MBSTRG(language), 
         &MBSTRG(default_detect_order_list), 
&MBSTRG(default_detect_order_list_size));
 
-       if (MBSTRG(internal_encoding) == mbfl_no_encoding_invalid) {
-               char *default_enc = NULL;
-               switch (MBSTRG(current_language)) {
-                       case mbfl_no_language_uni:
-                               default_enc = "UTF-8";
-                               break;
-                       case mbfl_no_language_japanese:
-                               default_enc = "EUC-JP";
-                               break;
-                       case mbfl_no_language_korean:
-                               default_enc = "EUC-KR";
-                               break;
-                       case mbfl_no_language_simplified_chinese:
-                               default_enc = "EUC-CN";
-                               break;
-                       case mbfl_no_language_traditional_chinese:
-                               default_enc = "EUC-TW";
-                               break;
-                       case mbfl_no_language_russian:
-                               default_enc = "KOI8-R";
-                               break;
-                       case mbfl_no_language_german:
-                               default_enc = "ISO-8859-15";
-                               break;
-                       case mbfl_no_language_armenian:
-                               default_enc = "ArmSCII-8";
-                               break;
-                       case mbfl_no_language_turkish:
-                               default_enc = "ISO-8859-9";
-                               break;
-                       case mbfl_no_language_english:
-                       default:
-                               default_enc = "ISO-8859-1";
-                               break;
-               }
-               if (default_enc) {
-                       zend_alter_ini_entry("mbstring.internal_encoding",
-                                            
sizeof("mbstring.internal_encoding"),
-                                            default_enc, strlen(default_enc),
-                                            PHP_INI_PERDIR, 
PHP_INI_STAGE_RUNTIME); 
-               }
-       }
-
        MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding);
        MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding);
        MBSTRG(current_filter_illegal_mode) = MBSTRG(filter_illegal_mode);
@@ -1084,22 +1098,20 @@
 {
        char *name = NULL;
        int name_len = 0;
-       enum mbfl_no_language no_language;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, 
&name_len) == FAILURE) {
                return;
        }
        if (name == NULL) {
-               RETURN_STRING((char 
*)mbfl_no_language2name(MBSTRG(current_language)), 1);
+               RETVAL_STRING((char *)mbfl_no_language2name(MBSTRG(language)), 
1);
        } else {
-               no_language = mbfl_name2no_language(name);
-               if (no_language == mbfl_no_language_invalid) {
+               if (FAILURE == zend_alter_ini_entry(
+                               "mbstring.language", 
sizeof("mbstring.language"),
+                               name, name_len, PHP_INI_USER, 
PHP_INI_STAGE_RUNTIME)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown 
language \"%s\"", name);
-                       RETURN_FALSE;
+                       RETVAL_FALSE;
                } else {
-                       php_mb_nls_get_default_detect_order_list(no_language, 
&MBSTRG(default_detect_order_list), &MBSTRG(default_detect_order_list_size));
-                       MBSTRG(current_language) = no_language;
-                       RETURN_TRUE;
+                       RETVAL_TRUE;
                }
        }
 }
@@ -1441,10 +1453,10 @@
        info.force_register_globals = (track_vars_array == NULL);
        info.report_errors          = 1;
        info.to_encoding            = MBSTRG(current_internal_encoding);
-       info.to_language            = MBSTRG(current_language);
+       info.to_language            = MBSTRG(language);
        info.from_encodings         = MBSTRG(http_input_list);
        info.num_from_encodings     = MBSTRG(http_input_list_size); 
-       info.from_language          = MBSTRG(current_language);
+       info.from_language          = MBSTRG(language);
 
        detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr 
TSRMLS_CC);
 
@@ -1532,7 +1544,7 @@
  
        /* feed the string */
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
        string.val = (unsigned char *)arg_string;
        string.len = arg_string_len;
@@ -1568,7 +1580,7 @@
                RETURN_FALSE;
        }
 
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        if (enc_name == NULL) {
                string.no_encoding = MBSTRG(current_internal_encoding);
        } else {
@@ -1600,9 +1612,9 @@
        
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
        offset = 0;
 
@@ -1667,9 +1679,9 @@
 
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|Zs", (char 
**)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, 
&enc_name, &enc_name_len) == FAILURE) {
@@ -1815,9 +1827,9 @@
 
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char 
**)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, 
&enc_name, &enc_name_len) == FAILURE) {
@@ -1873,9 +1885,9 @@
 
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|bs", (char 
**)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, 
&enc_name, &enc_name_len) == FAILURE) {
@@ -1931,9 +1943,9 @@
        char *from_encoding = 
(char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
 
@@ -1989,9 +2001,9 @@
        char *from_encoding = 
(char*)mbfl_no2preferred_mime_name(MBSTRG(current_internal_encoding));
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
 
@@ -2043,9 +2055,9 @@
 
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", (char 
**)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, 
&enc_name_len) == FAILURE) {
@@ -2083,7 +2095,7 @@
        mbfl_string string, result, *ret;
 
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
 
        argc = ZEND_NUM_ARGS();
@@ -2175,7 +2187,7 @@
        mbfl_string string, result, *ret;
 
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
 
        argc = ZEND_NUM_ARGS();
@@ -2265,7 +2277,7 @@
 
        mbfl_string_init(&string);
 
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", (char 
**)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
@@ -2299,9 +2311,9 @@
 
        mbfl_string_init(&string);
        mbfl_string_init(&marker);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
-       marker.no_language = MBSTRG(current_language);
+       marker.no_language = MBSTRG(language);
        marker.no_encoding = MBSTRG(current_internal_encoding);
        marker.val = NULL;
        marker.len = 0;
@@ -2397,7 +2409,7 @@
        mbfl_string_init(&result);
        from_encoding = MBSTRG(current_internal_encoding);
        string.no_encoding = from_encoding;
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.val = (unsigned char *)input;
        string.len = length;
 
@@ -2667,7 +2679,7 @@
 
        convert_to_string_ex(arg_str);
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.val = (unsigned char *)Z_STRVAL_PP(arg_str);
        string.len = Z_STRLEN_PP(arg_str);
        ret = mbfl_identify_encoding_name(&string, elist, size, strict);
@@ -2830,7 +2842,7 @@
        long indent = 0;
 
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sssl", (char 
**)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, 
&trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
@@ -2847,7 +2859,7 @@
                        RETURN_FALSE;
                }
        } else {
-               const mbfl_language *lang = 
mbfl_no2language(MBSTRG(current_language));
+               const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
                if (lang != NULL) {
                        charset = lang->mail_charset;
                        transenc = lang->mail_header_encoding;
@@ -2879,7 +2891,7 @@
        mbfl_string string, result, *ret;
 
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", (char 
**)&string.val, &string.len) == FAILURE) {
@@ -2908,7 +2920,7 @@
        int encname_len;
 
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ss", (char 
**)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == 
FAILURE) {
@@ -3040,7 +3052,7 @@
        mbfl_string_init(&result);
        from_encoding = MBSTRG(current_internal_encoding);
        string.no_encoding = from_encoding;
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
 
        /* pre-conversion encoding */
        elist = NULL;
@@ -3244,7 +3256,7 @@
 
        convert_to_string_ex(arg1);
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.no_encoding = MBSTRG(current_internal_encoding);
        string.val = (unsigned char *)Z_STRVAL_PP(arg1);
        string.len = Z_STRLEN_PP(arg1);
@@ -3583,7 +3595,7 @@
        tran_cs = mbfl_no_encoding_utf8;
        head_enc = mbfl_no_encoding_base64;
        body_enc = mbfl_no_encoding_base64;
-       lang = mbfl_no2language(MBSTRG(current_language));
+       lang = mbfl_no2language(MBSTRG(language));
        if (lang != NULL) {
                tran_cs = lang->mail_charset;
                head_enc = lang->mail_header_encoding;
@@ -3701,7 +3713,7 @@
 
        /* Subject: */
        if (subject != NULL && subject_len >= 0) {
-               orig_str.no_language = MBSTRG(current_language);
+               orig_str.no_language = MBSTRG(language);
                orig_str.val = (unsigned char *)subject;
                orig_str.len = subject_len;
                orig_str.no_encoding = MBSTRG(current_internal_encoding);
@@ -3720,7 +3732,7 @@
 
        /* message body */
        if (message != NULL) {
-               orig_str.no_language = MBSTRG(current_language);
+               orig_str.no_language = MBSTRG(language);
                orig_str.val = message;
                orig_str.len = message_len;
                orig_str.no_encoding = MBSTRG(current_internal_encoding);
@@ -3837,7 +3849,7 @@
        char *name;
        const struct mb_overload_def *over_func;
        zval *row1, *row2;
-       const mbfl_language *lang = mbfl_no2language(MBSTRG(current_language));
+       const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
        enum mbfl_no_encoding *entry;
 #ifdef ZEND_MULTIBYTE
        zval *row3;
@@ -3890,7 +3902,7 @@
                } else {
                        add_assoc_string(return_value, "encoding_translation", 
"Off", 1);
                }
-               if ((name = (char 
*)mbfl_no_language2name(MBSTRG(current_language))) != NULL) {
+               if ((name = (char *)mbfl_no_language2name(MBSTRG(language))) != 
NULL) {
                        add_assoc_string(return_value, "language", name, 1);
                }               
                n = MBSTRG(current_detect_order_list_size);
@@ -3985,7 +3997,7 @@
                        RETVAL_STRING("Off", 1);
                }
        } else if (!strcasecmp("language", typ)) {
-               if ((name = (char 
*)mbfl_no_language2name(MBSTRG(current_language))) != NULL) {
+               if ((name = (char *)mbfl_no_language2name(MBSTRG(language))) != 
NULL) {
                        RETVAL_STRING(name, 1);
                }               
        } else if (!strcasecmp("detect_order", typ)) {
@@ -4083,7 +4095,7 @@
        mbfl_string_init(&string);
        mbfl_string_init(&result);
        string.no_encoding = no_encoding;
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
 
        string.val = (unsigned char *)var;
        string.len = var_len;
@@ -4245,7 +4257,7 @@
        mbfl_string_init(&string);
        mbfl_string_init(&result);
        string.no_encoding = from_encoding;
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
 
        for (i=0; i<num; i++){
                string.val = (char*)str[i];
@@ -4326,7 +4338,7 @@
        }
 
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
 
        identd = mbfl_encoding_detector_new(elist, size, 
MBSTRG(strict_detection));
 
@@ -4364,9 +4376,9 @@
 
        mbfl_string_init(&haystack);
        mbfl_string_init(&needle);
-       haystack.no_language = MBSTRG(current_language);
+       haystack.no_language = MBSTRG(language);
        haystack.no_encoding = MBSTRG(current_internal_encoding);
-       needle.no_language = MBSTRG(current_language);
+       needle.no_language = MBSTRG(language);
        needle.no_encoding = MBSTRG(current_internal_encoding);
 
        do {
@@ -4492,7 +4504,7 @@
        }
 
        mbfl_string_init(&string);
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.val = (char*)arg_string;
        string.len = arg_length;
        ret = mbfl_identify_encoding_name(&string, elist, size, 0);
@@ -4530,7 +4542,7 @@
        mbfl_string_init(&string);
        mbfl_string_init(&result);
        string.no_encoding = from_encoding;
-       string.no_language = MBSTRG(current_language);
+       string.no_language = MBSTRG(language);
        string.val = (char*)from;
        string.len = from_length;
 
@@ -4565,7 +4577,7 @@
        mbfl_string mb_string;
 
        mbfl_string_init(&mb_string);
-       mb_string.no_language = MBSTRG(current_language);
+       mb_string.no_language = MBSTRG(language);
        mb_string.no_encoding = mbfl_name2no_encoding(encoding);
        mb_string.val = (char*)string;
        mb_string.len = length;
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.h?r1=1.66.2.4.2.6&r2=1.66.2.4.2.7&diff_format=u
Index: php-src/ext/mbstring/mbstring.h
diff -u php-src/ext/mbstring/mbstring.h:1.66.2.4.2.6 
php-src/ext/mbstring/mbstring.h:1.66.2.4.2.7
--- php-src/ext/mbstring/mbstring.h:1.66.2.4.2.6        Mon Dec 31 07:20:07 2007
+++ php-src/ext/mbstring/mbstring.h     Sat Aug  2 20:49:48 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mbstring.h,v 1.66.2.4.2.6 2007/12/31 07:20:07 sebastian Exp $ */
+/* $Id: mbstring.h,v 1.66.2.4.2.7 2008/08/02 20:49:48 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
@@ -163,7 +163,6 @@
 
 ZEND_BEGIN_MODULE_GLOBALS(mbstring)
        enum mbfl_no_language language;
-       enum mbfl_no_language current_language;
        enum mbfl_no_encoding internal_encoding;
        enum mbfl_no_encoding current_internal_encoding;
 #ifdef ZEND_MULTIBYTE

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to