pollita Sat Sep 6 03:34:59 2003 EDT Modified files: /php-src/ext/standard http.c Log: Fix Objects bug. (Objects != Arrays) Index: php-src/ext/standard/http.c diff -u php-src/ext/standard/http.c:1.3 php-src/ext/standard/http.c:1.4 --- php-src/ext/standard/http.c:1.3 Sat Sep 6 02:57:40 2003 +++ php-src/ext/standard/http.c Sat Sep 6 03:34:58 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http.c,v 1.3 2003/09/06 06:57:40 pollita Exp $ */ +/* $Id: http.c,v 1.4 2003/09/06 07:34:58 pollita Exp $ */ #include "http.h" #include "php_ini.h" @@ -58,7 +58,7 @@ key_len -= 1; } - if (zend_hash_get_current_data_ex(ht, (void **)&zdata, NULL) == FAILURE || !zdata) { + if (zend_hash_get_current_data_ex(ht, (void **)&zdata, NULL) == FAILURE || !zdata || !(*zdata)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error traversing form data array."); return FAILURE; } @@ -112,7 +112,7 @@ *p = '\0'; } ht->nApplyCount++; - php_url_encode_hash_ex(Z_ARRVAL_PP(zdata), formstr, NULL, 0, newprefix, newprefix_len, "]", 1 TSRMLS_CC); + php_url_encode_hash_ex(HASH_OF(*zdata), formstr, NULL, 0, newprefix, newprefix_len, "]", 1 TSRMLS_CC); ht->nApplyCount--; efree(newprefix); } else if (Z_TYPE_PP(zdata) == IS_NULL || Z_TYPE_PP(zdata) == IS_RESOURCE) { @@ -175,7 +175,12 @@ int prefix_len = 0; smart_str formstr = {0}; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|s", &formdata, &prefix, &prefix_len) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &formdata, &prefix, &prefix_len) != SUCCESS) { + RETURN_FALSE; + } + + if (Z_TYPE_P(formdata) != IS_ARRAY && Z_TYPE_P(formdata) != IS_OBJECT) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given."); RETURN_FALSE; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php