]>
Commit | Line | Data |
---|---|---|
f6d98024 ER |
1 | --- /repository/php-src/ext/mbstring/mb_gpc.c 2008/12/31 11:17:39 1.17.2.2.2.5 |
2 | +++ /repository/php-src/ext/mbstring/mb_gpc.c 2009/03/15 20:44:17 1.17.2.2.2.6 | |
3 | @@ -58,6 +58,11 @@ | |
4 | int free_buffer=0; | |
5 | enum mbfl_no_encoding detected; | |
6 | php_mb_encoding_handler_info_t info; | |
7 | + | |
8 | + { | |
9 | + char *value = zend_ini_string("mbstring.internal_encoding", sizeof("mbstring.internal_encoding"), 0); | |
10 | + _php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0 TSRMLS_CC); | |
11 | + } | |
12 | ||
13 | if (!MBSTRG(encoding_translation)) { | |
14 | php_default_treat_data(arg, str, destArray TSRMLS_CC); | |
15 | --- /repository/php-src/ext/mbstring/mbstring.c 2009/02/15 07:11:23 1.224.2.22.2.46 | |
16 | +++ /repository/php-src/ext/mbstring/mbstring.c 2009/03/15 20:44:17 1.224.2.22.2.47 | |
17 | @@ -656,7 +656,7 @@ | |
18 | /* }}} */ | |
19 | ||
20 | /* {{{ static _php_mb_ini_mbstring_internal_encoding_set */ | |
21 | -static int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC) | |
22 | +int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC) | |
23 | { | |
24 | enum mbfl_no_encoding no_encoding; | |
25 | const char *enc_name = NULL; | |
26 | @@ -826,7 +826,6 @@ | |
27 | if (MBSTRG(encoding_translation)) { | |
28 | sapi_unregister_post_entry(php_post_entries TSRMLS_CC); | |
29 | sapi_register_post_entries(mbstr_post_entries TSRMLS_CC); | |
30 | - sapi_register_treat_data(mbstr_treat_data); | |
31 | } else { | |
32 | sapi_unregister_post_entry(mbstr_post_entries TSRMLS_CC); | |
33 | sapi_register_post_entries(php_post_entries TSRMLS_CC); | |
34 | @@ -927,9 +926,12 @@ | |
35 | ||
36 | REGISTER_INI_ENTRIES(); | |
37 | ||
38 | + /* This is a global handler. Should not be set in a per-request handler. */ | |
39 | + sapi_register_treat_data(mbstr_treat_data); | |
40 | + | |
41 | + /* Post handlers are stored in the thread-local context. */ | |
42 | if (MBSTRG(encoding_translation)) { | |
43 | sapi_register_post_entries(mbstr_post_entries TSRMLS_CC); | |
44 | - sapi_register_treat_data(mbstr_treat_data); | |
45 | } | |
46 | ||
47 | REGISTER_LONG_CONSTANT("MB_OVERLOAD_MAIL", MB_OVERLOAD_MAIL, CONST_CS | CONST_PERSISTENT); | |
48 | @@ -967,11 +969,6 @@ | |
49 | enum mbfl_no_encoding *list=NULL, *entry; | |
50 | zend_function *func, *orig; | |
51 | const struct mb_overload_def *p; | |
52 | - | |
53 | - { | |
54 | - char *value = zend_ini_string("mbstring.internal_encoding", sizeof("mbstring.internal_encoding"), 0); | |
55 | - _php_mb_ini_mbstring_internal_encoding_set(value, value ? strlen(value): 0 TSRMLS_CC); | |
56 | - } | |
57 | ||
58 | MBSTRG(current_internal_encoding) = MBSTRG(internal_encoding); | |
59 | MBSTRG(current_http_output_encoding) = MBSTRG(http_output_encoding); | |
60 | --- /repository/php-src/ext/mbstring/mbstring.h 2008/12/31 11:17:39 1.66.2.4.2.9 | |
61 | +++ /repository/php-src/ext/mbstring/mbstring.h 2009/03/15 20:44:17 1.66.2.4.2.10 | |
62 | @@ -158,6 +158,9 @@ | |
63 | MBSTRING_API int php_mb_gpc_encoding_detector(char **arg_string, int *arg_length, int num, char *arg_list TSRMLS_DC); | |
64 | ||
65 | MBSTRING_API int php_mb_stripos(int mode, char *old_haystack, int old_haystack_len, char *old_needle, int old_needle_len, long offset, char *from_encoding TSRMLS_DC); | |
66 | + | |
67 | +/* internal use only */ | |
68 | +int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_value_length TSRMLS_DC); | |
69 | ||
70 | ZEND_BEGIN_MODULE_GLOBALS(mbstring) | |
71 | enum mbfl_no_language language; |