};
function_entry mbstring_functions[] = {
- PHP_FE(mbstr_internal_encoding, NULL)
- PHP_FE(mbstr_http_input, NULL)
- PHP_FE(mbstr_http_output, NULL)
- PHP_FE(mbstr_detect_order, NULL)
- PHP_FE(mbstr_substitute_character, NULL)
- PHP_FE(mbstr_gpc_handler, NULL)
- PHP_FE(mbstr_output_handler, NULL)
- PHP_FE(mbstr_preferred_mime_name, NULL)
+ PHP_FE(mb_internal_encoding, NULL)
+ PHP_FE(mb_http_input, NULL)
+ PHP_FE(mb_http_output, NULL)
+ PHP_FE(mb_detect_order, NULL)
+ PHP_FE(mb_substitute_character, NULL)
+ PHP_FE(mb_gpc_handler, NULL)
+ PHP_FE(mb_output_handler, NULL)
+ PHP_FE(mb_preferred_mime_name, NULL)
PHP_FE(mb_strlen, NULL)
PHP_FE(mb_strpos, NULL)
PHP_FE(mb_strrpos, NULL)
PHP_FE(mb_strcut, NULL)
PHP_FE(mb_strwidth, NULL)
PHP_FE(mb_strimwidth, NULL)
- PHP_FE(mbstr_convert_encoding, NULL)
- PHP_FE(mbstr_detect_encoding, NULL)
- PHP_FE(mbstr_convert_kana, NULL)
- PHP_FE(mbstr_encode_mimeheader, NULL)
- PHP_FE(mbstr_decode_mimeheader, NULL)
- PHP_FE(mbstr_convert_variables, third_and_rest_force_ref)
- PHP_FE(mbstr_encode_numericentity, NULL)
- PHP_FE(mbstr_decode_numericentity, NULL)
- PHP_FE(mbstr_send_mail, NULL)
+ PHP_FE(mb_convert_encoding, NULL)
+ PHP_FE(mb_detect_encoding, NULL)
+ PHP_FE(mb_convert_kana, NULL)
+ PHP_FE(mb_encode_mimeheader, NULL)
+ PHP_FE(mb_decode_mimeheader, NULL)
+ PHP_FE(mb_convert_variables, third_and_rest_force_ref)
+ PHP_FE(mb_encode_numericentity, NULL)
+ PHP_FE(mb_decode_numericentity, NULL)
+ PHP_FE(mb_send_mail, NULL)
PHP_FALIAS(mbstrlen, mb_strlen, NULL)
PHP_FALIAS(mbstrpos, mb_strpos, NULL)
PHP_FALIAS(mbstrrpos, mb_strrpos, NULL)
PHP_FALIAS(mbstrcut, mb_strcut, NULL)
PHP_FALIAS(mbstrwidth, mb_strwidth, NULL)
PHP_FALIAS(mbstrimwidth, mb_strimwidth, NULL)
- PHP_FALIAS(i18n_internal_encoding, mbstr_internal_encoding, NULL)
- PHP_FALIAS(i18n_http_input, mbstr_http_input, NULL)
- PHP_FALIAS(i18n_http_output, mbstr_http_output, NULL)
- PHP_FALIAS(i18n_convert, mbstr_convert_encoding, NULL)
- PHP_FALIAS(i18n_discover_encoding, mbstr_detect_encoding, NULL)
- PHP_FALIAS(i18n_mime_header_encode, mbstr_encode_mimeheader, NULL)
- PHP_FALIAS(i18n_mime_header_decode, mbstr_decode_mimeheader, NULL)
- PHP_FALIAS(i18n_ja_jp_hantozen, mbstr_convert_kana, NULL)
+ PHP_FALIAS(i18n_internal_encoding, mb_internal_encoding, NULL)
+ PHP_FALIAS(i18n_http_input, mb_http_input, NULL)
+ PHP_FALIAS(i18n_http_output, mb_http_output, NULL)
+ PHP_FALIAS(i18n_convert, mb_convert_encoding, NULL)
+ PHP_FALIAS(i18n_discover_encoding, mb_detect_encoding, NULL)
+ PHP_FALIAS(i18n_mime_header_encode, mb_encode_mimeheader, NULL)
+ PHP_FALIAS(i18n_mime_header_decode, mb_decode_mimeheader, NULL)
+ PHP_FALIAS(i18n_ja_jp_hantozen, mb_convert_kana, NULL)
{ NULL, NULL, NULL }
};
pglobals->http_input_identify_get = mbfl_no_encoding_invalid;
pglobals->http_input_identify_post = mbfl_no_encoding_invalid;
pglobals->http_input_identify_cookie = mbfl_no_encoding_invalid;
+ pglobals->http_input_identify_string = mbfl_no_encoding_invalid;
pglobals->http_input_list = NULL;
pglobals->http_input_list_size = 0;
pglobals->detect_order_list = NULL;
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(http_input_identify) = mbfl_no_encoding_invalid;
- MBSTRG(http_input_identify_get) = mbfl_no_encoding_invalid;
- MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid;
- MBSTRG(http_input_identify_cookie) = mbfl_no_encoding_invalid;
+
n = 0;
if (MBSTRG(detect_order_list)) {
list = MBSTRG(detect_order_list);
-/* {{{ proto string mbstr_internal_encoding([string encoding])
+/* {{{ proto string mb_internal_encoding([string encoding])
Sets the current internal encoding or Returns the current internal encoding as a string. */
-PHP_FUNCTION(mbstr_internal_encoding)
+PHP_FUNCTION(mb_internal_encoding)
{
pval **arg1;
char *name;
/* }}} */
-/* {{{ proto string mbstr_http_input([string type])
+/* {{{ proto string mb_http_input([string type])
Returns the input encoding. */
-PHP_FUNCTION(mbstr_http_input)
+PHP_FUNCTION(mb_http_input)
{
pval **arg1;
int result, retname, n, *entry;
case 'c':
result = MBSTRG(http_input_identify_cookie);
break;
+ case 'S':
+ case 's':
+ result = MBSTRG(http_input_identify_string);
+ break;
case 'I':
case 'i':
if (array_init(return_value) == FAILURE) {
/* }}} */
-/* {{{ proto string mbstr_http_output([string encoding])
+/* {{{ proto string mb_http_output([string encoding])
Sets the current output_encoding or Returns the current output_encoding as a string. */
-PHP_FUNCTION(mbstr_http_output)
+PHP_FUNCTION(mb_http_output)
{
pval **arg1;
char *name;
/* }}} */
-/* {{{ proto array mbstr_detect_order([mixed encoding-list])
+/* {{{ proto array mb_detect_order([mixed encoding-list])
Sets the current detect_order or Return the current detect_order as a array. */
-PHP_FUNCTION(mbstr_detect_order)
+PHP_FUNCTION(mb_detect_order)
{
pval **arg1;
int n, size, *list, *entry;
/* }}} */
-/* {{{ proto mixed mbstr_substitute_character([mixed substchar])
+/* {{{ proto mixed mb_substitute_character([mixed substchar])
Sets the current substitute_character or Returns the current substitute_character. */
-PHP_FUNCTION(mbstr_substitute_character)
+PHP_FUNCTION(mb_substitute_character)
{
pval **arg1;
MBSTRLS_FETCH();
/* }}} */
-/* {{{ proto string mbstr_preferred_mime_name(string encoding)
+/* {{{ proto string mb_preferred_mime_name(string encoding)
Return the preferred MIME name (charset) as a string. */
-PHP_FUNCTION(mbstr_preferred_mime_name)
+PHP_FUNCTION(mb_preferred_mime_name)
{
pval **arg1;
enum mbfl_no_encoding no_encoding;
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
} else {
- php_error(E_WARNING, "Unable to create converter in php_mbstr_encoding_handler()");
+ php_error(E_WARNING, "Unable to create converter in php_mb_encoding_handler()");
}
}
}
n+=2;
}
+ MBSTRG(http_input_identify) = from_encoding;
+
if (convd != NULL) {
mbfl_buffer_converter_delete(convd);
}
SAPI_POST_HANDLER_FUNC(php_mbstr_post_handler)
{
+ MBSTRLS_FETCH();
+
+ MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid;
+
php_mbstr_encoding_handler(arg, SG(request_info).post_data, "&");
+
+ if (MBSTRG(http_input_identify) != mbfl_no_encoding_invalid) {
+ MBSTRG(http_input_identify_post) = MBSTRG(http_input_identify);
+ }
}
/* http input processing */
const char *c_var;
pval *array_ptr;
int free_buffer=0;
-
+ MBSTRLS_FETCH();
+
switch (arg) {
case PARSE_POST:
case PARSE_GET:
}
switch (arg) {
+ case PARSE_POST:
+ case PARSE_GET:
+ case PARSE_STRING:
+ separator = (char *) estrdup(PG(arg_separator).input);
+ break;
+ case PARSE_COOKIE:
+ separator = ";\0";
+ break;
+ }
+
+ switch(arg) {
+ case PARSE_POST:
+ MBSTRG(http_input_identify_post) = mbfl_no_encoding_invalid;
+ break;
+ case PARSE_GET:
+ MBSTRG(http_input_identify_get) = mbfl_no_encoding_invalid;
+ break;
+ case PARSE_COOKIE:
+ MBSTRG(http_input_identify_cookie) = mbfl_no_encoding_invalid;
+ break;
+ case PARSE_STRING:
+ MBSTRG(http_input_identify_string) = mbfl_no_encoding_invalid;
+ break;
+ }
+
+ php_mbstr_encoding_handler(array_ptr, res, separator);
+
+ if (MBSTRG(http_input_identify) != mbfl_no_encoding_invalid) {
+ switch(arg){
case PARSE_POST:
+ MBSTRG(http_input_identify_post) = MBSTRG(http_input_identify);
+ break;
case PARSE_GET:
- case PARSE_STRING:
- separator = (char *) estrdup(PG(arg_separator).input);
+ MBSTRG(http_input_identify_get) = MBSTRG(http_input_identify);
break;
case PARSE_COOKIE:
- separator = ";\0";
+ MBSTRG(http_input_identify_cookie) = MBSTRG(http_input_identify);
+ break;
+ case PARSE_STRING:
+ MBSTRG(http_input_identify_string) = MBSTRG(http_input_identify);
break;
+ }
}
-
- php_mbstr_encoding_handler(array_ptr, res, separator);
if(arg != PARSE_COOKIE) {
efree(separator);
}
}
-/* {{{ proto array mbstr_gpc_handler(string query, int type)
+/* {{{ proto array mb_gpc_handler(string query, int type)
*/
-PHP_FUNCTION(mbstr_gpc_handler)
+PHP_FUNCTION(mb_gpc_handler)
{
pval **arg_str;
char *var, *val, *strtok_buf, **val_list;
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
} else {
- php_error(E_WARNING, "Unable to create converter in mbstr_gpc_handler()");
+ php_error(E_WARNING, "Unable to create converter in mb_gpc_handler()");
}
}
-/* {{{ proto string mbstr_output_handler(string contents, int status)
+/* {{{ proto string mb_output_handler(string contents, int status)
Returns string in output buffer converted to the http_output encoding */
-PHP_FUNCTION(mbstr_output_handler)
+PHP_FUNCTION(mb_output_handler)
{
pval **arg_string, **arg_status;
mbfl_string string, result, *ret;
-/* {{{ proto string mbstr_convert_encoding(string str, string to-encoding [, mixed from-encoding])
+/* {{{ proto string mb_convert_encoding(string str, string to-encoding [, mixed from-encoding])
Returns converted string in desired encoding */
-PHP_FUNCTION(mbstr_convert_encoding)
+PHP_FUNCTION(mb_convert_encoding)
{
pval **arg_str, **arg_new, **arg_old;
mbfl_string string, result, *ret;
if (from_encoding != mbfl_no_encoding_invalid) {
string.no_encoding = from_encoding;
} else {
- php_error(E_WARNING, "Unable to detect encoding in mbstr_convert_encoding()");
+ php_error(E_WARNING, "Unable to detect encoding in mb_convert_encoding()");
from_encoding = mbfl_no_encoding_pass;
to_encoding = from_encoding;
string.no_encoding = from_encoding;
}
} else {
- php_error(E_WARNING, "illegal from-encoding in mbstr_convert_encoding()");
+ php_error(E_WARNING, "illegal from-encoding in mb_convert_encoding()");
}
if (list != NULL) {
efree((void *)list);
/* initialize converter */
convd = mbfl_buffer_converter_new(from_encoding, to_encoding, string.len);
if (convd == NULL) {
- php_error(E_WARNING, "Unable to create converter in mbstr_convert_encoding()");
+ php_error(E_WARNING, "Unable to create converter in mb_convert_encoding()");
RETURN_FALSE;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
-/* {{{ proto string mbstr_detect_encoding(string str [, mixed encoding_list])
+/* {{{ proto string mb_detect_encoding(string str [, mixed encoding_list])
Encoding of the given string is returned (as a string) */
-PHP_FUNCTION(mbstr_detect_encoding)
+PHP_FUNCTION(mb_detect_encoding)
{
pval **arg_str, **arg_list;
mbfl_string string;
-/* {{{ proto string mbstr_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed]]])
+/* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed]]])
Convert the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?= */
-PHP_FUNCTION(mbstr_encode_mimeheader)
+PHP_FUNCTION(mb_encode_mimeheader)
{
pval **argv[4];
enum mbfl_no_encoding charset, transenc;
-/* {{{ proto string mbstr_decode_mimeheader(string string)
+/* {{{ proto string mb_decode_mimeheader(string string)
Decodes the MIME "encoded-word" in the string */
-PHP_FUNCTION(mbstr_decode_mimeheader)
+PHP_FUNCTION(mb_decode_mimeheader)
{
pval **arg_str;
mbfl_string string, result, *ret;
-/* {{{ proto string mbstr_convert_kana(string str [,string option] [, string encoding])
+/* {{{ proto string mb_convert_kana(string str [,string option] [, string encoding])
Conversion between full-width character and half-width character (Japanese) */
-PHP_FUNCTION(mbstr_convert_kana)
+PHP_FUNCTION(mb_convert_kana)
{
pval **arg1, **arg2, **arg3;
int argc, opt, i, n;
-/* {{{ proto string mbstr_convert_variables(string to-encoding, mixed from-encoding, mixed ...)
+/* {{{ proto string mb_convert_variables(string to-encoding, mixed from-encoding, mixed ...)
Convert the string resource in variables to desired encoding */
-PHP_FUNCTION(mbstr_convert_variables)
+PHP_FUNCTION(mb_convert_variables)
{
pval ***args, **hash_entry;
HashTable *target_hash;
mbfl_encoding_detector_delete(identd);
}
if (from_encoding == mbfl_no_encoding_invalid) {
- php_error(E_WARNING, "Unable to detect encoding in mbstr_convert_variables()");
+ php_error(E_WARNING, "Unable to detect encoding in mb_convert_variables()");
from_encoding = mbfl_no_encoding_pass;
}
}
if (from_encoding != mbfl_no_encoding_pass) {
convd = mbfl_buffer_converter_new(from_encoding, to_encoding, 0);
if (convd == NULL) {
- php_error(E_WARNING, "Unable to create converter in mbstr_convert_variables()");
+ php_error(E_WARNING, "Unable to create converter in mb_convert_variables()");
RETURN_FALSE;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
efree((void *)convmap);
}
-/* {{{ proto string mbstr_encode_numericentity(string string, array convmap [, string encoding])
+/* {{{ proto string mb_encode_numericentity(string string, array convmap [, string encoding])
Convert specified characters to HTML numeric entities */
-PHP_FUNCTION(mbstr_encode_numericentity)
+PHP_FUNCTION(mb_encode_numericentity)
{
php_mbstr_numericentity_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
-/* {{{ proto string mbstr_decode_numericentity(string string, array convmap [, string encoding])
+/* {{{ proto string mb_decode_numericentity(string string, array convmap [, string encoding])
Convert HTML numeric entities to character code */
-PHP_FUNCTION(mbstr_decode_numericentity)
+PHP_FUNCTION(mb_decode_numericentity)
{
php_mbstr_numericentity_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
#if HAVE_SENDMAIL
-/* {{{ proto int mbstr_send_mail(string to, string subject, string message [, string additional_headers])
+/* {{{ proto int mb_send_mail(string to, string subject, string message [, string additional_headers])
Send an email message with MIME scheme */
-PHP_FUNCTION(mbstr_send_mail)
+PHP_FUNCTION(mb_send_mail)
{
int argc, n;
pval **argv[4];
if (Z_STRVAL_PP(argv[0])) {
to = Z_STRVAL_PP(argv[0]);
} else {
- php_error(E_WARNING, "No to field in mbstr_send_mail()");
+ php_error(E_WARNING, "No to field in mb_send_mail()");
err = 1;
}
subject = Z_STRVAL_PP(argv[1]);
}
} else {
- php_error(E_WARNING, "No subject field in mbstr_send_mail()");
+ php_error(E_WARNING, "No subject field in mb_send_mail()");
err = 1;
}
}
} else {
/* this is not really an error, so it is allowed. */
- php_error(E_WARNING, "No message string in mbstr_send_mail()");
+ php_error(E_WARNING, "No message string in mb_send_mail()");
message = NULL;
}
#else /* HAVE_SENDMAIL */
-PHP_FUNCTION(mbstr_send_mail)
+PHP_FUNCTION(mb_send_mail)
{
RETURN_FALSE;
}