iliaa Wed Feb 11 14:26:24 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/mbstring mbstring.c
Log:
Improved param parsing
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.25.2.46&r2=1.224.2.22.2.25.2.47&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.46
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.47
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.25.2.46 Mon Feb 9
15:34:01 2009
+++ php-src/ext/mbstring/mbstring.c Wed Feb 11 14:26:24 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.224.2.22.2.25.2.46 2009/02/09 15:34:01 iliaa Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.25.2.47 2009/02/11 14:26:24 iliaa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -1882,17 +1882,16 @@
Sets the current detect_order or Return the current detect_order as a array
*/
PHP_FUNCTION(mb_detect_order)
{
- size_t argc = ZEND_NUM_ARGS();
- zval **arg1;
+ zval **arg1 = NULL;
int n, size;
enum mbfl_no_encoding *list, *entry;
char *name;
- if (zend_parse_parameters(argc TSRMLS_CC, "|Z", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|Z", &arg1) ==
FAILURE) {
return;
}
- if (argc == 0) {
+ if (!arg1) {
array_init(return_value);
entry = MBSTRG(current_detect_order_list);
n = MBSTRG(current_detect_order_list_size);
@@ -1945,13 +1944,13 @@
Sets the current substitute_character or returns the current
substitute_character */
PHP_FUNCTION(mb_substitute_character)
{
- zval **arg1;
+ zval **arg1 = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|Z", &arg1) ==
FAILURE) {
return;
}
- if (ZEND_NUM_ARGS() == 0) {
+ if (!arg1) {
if (MBSTRG(current_filter_illegal_mode) ==
MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE) {
RETURN_STRING("none", 1);
} else if (MBSTRG(current_filter_illegal_mode) ==
MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php