]> granicus.if.org Git - php/commitdiff
disabled mb_list_*_names() and mb_list_encodings(arg) which are introduced in PHP...
authorRui Hirokawa <hirokawa@php.net>
Sun, 24 Sep 2006 07:10:54 +0000 (07:10 +0000)
committerRui Hirokawa <hirokawa@php.net>
Sun, 24 Sep 2006 07:10:54 +0000 (07:10 +0000)
ext/mbstring/mbstring.c

index a8cdb4f0f0a898a500e9104130864c366b79e296..77ce2c07f241d1ca6b9b7dd027ca22bd19fdb2a7 100644 (file)
@@ -224,8 +224,6 @@ zend_function_entry mbstring_functions[] = {
        PHP_FE(mb_convert_encoding,             NULL)
        PHP_FE(mb_detect_encoding,              NULL)
        PHP_FE(mb_list_encodings,               NULL)
-       PHP_FE(mb_list_encodings_alias_names,           NULL)
-       PHP_FE(mb_list_mime_names,              NULL)
        PHP_FE(mb_convert_kana,                 NULL)
        PHP_FE(mb_encode_mimeheader,    NULL)
        PHP_FE(mb_decode_mimeheader,    NULL)
@@ -2657,41 +2655,19 @@ PHP_FUNCTION(mb_detect_encoding)
 }
 /* }}} */
 
-/* {{{ proto mixed mb_list_encodings([string alias_encoding])
-   Returns an array of all supported entity encodings or Returns the entity encoding as a string */
+/* {{{ proto mixed mb_list_encodings()
+   Returns an array of all supported entity encodings */
 PHP_FUNCTION(mb_list_encodings)
 {
        const mbfl_encoding **encodings;
        const mbfl_encoding *encoding;
-       enum mbfl_no_encoding no_encoding;
        int i;
-       char *name = NULL;
-       int name_len;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) {
-               RETURN_FALSE;
-       }
-
-       if (name == NULL) {
-               array_init(return_value);
-               i = 0;
-               encodings = mbfl_get_supported_encodings();
-               while ((encoding = encodings[i++]) != NULL) {
-                       add_next_index_string(return_value, (char *) encoding->name, 1);
-               }
-       } else {
-               no_encoding = mbfl_name2no_encoding(name);
-               if (no_encoding == mbfl_no_encoding_invalid) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", name);
-                       RETURN_FALSE;
-               }
 
-               name = (char *)mbfl_no_encoding2name(no_encoding);
-               if (name != NULL) {
-                       RETURN_STRING(name, 1);
-               } else {
-                       RETURN_FALSE;
-               }
+       array_init(return_value);
+       i = 0;
+       encodings = mbfl_get_supported_encodings();
+       while ((encoding = encodings[i++]) != NULL) {
+               add_next_index_string(return_value, (char *) encoding->name, 1);
        }
 }
 /* }}} */