cvs: pecl /http http_functions.c

From: Date: Thu, 24 Mar 2005 16:30:56 +0000
Subject: cvs: pecl /http http_functions.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-2898@lists.php.net to get a copy of this message
mike Thu Mar 24 11:30:56 2005 EDT Modified files: /pecl/http http_functions.c Log: * added arg_sep param ot http_build_query() http://cvs.php.net/diff.php/pecl/http/http_functions.c?r1=1.15&r2=1.16&ty=u Index: pecl/http/http_functions.c diff -u pecl/http/http_functions.c:1.15 pecl/http/http_functions.c:1.16 --- pecl/http/http_functions.c:1.15 Mon Mar 21 14:33:37 2005 +++ pecl/http/http_functions.c Thu Mar 24 11:30:56 2005 @@ -13,7 +13,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http_functions.c,v 1.15 2005/03/21 19:33:37 mike Exp $ */ +/* $Id: http_functions.c,v 1.16 2005/03/24 16:30:56 mike Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -952,16 +952,16 @@ /* {{{ Sara Golemons http_build_query() */ #ifndef ZEND_ENGINE_2 -/* {{{ proto string http_build_query(mixed formdata [, string prefix]) +/* {{{ proto string http_build_query(mixed formdata [, string prefix[, string arg_separator]]) Generates a form-encoded query string from an associative array or object. */ PHP_FUNCTION(http_build_query) { zval *formdata; - char *prefix = NULL, *arg_sep = NULL; - int prefix_len = 0; + int prefix_len = 0, arg_sep_len = 0; + char *prefix = NULL, *arg_sep = INI_STR("arg_separator.output"); phpstr *formstr = phpstr_new(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &formdata, &prefix, &prefix_len) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ss", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len) != SUCCESS) { RETURN_FALSE; } @@ -970,7 +970,7 @@ RETURN_FALSE; } - if (!strlen(arg_sep = INI_STR("arg_separator.output"))) { + if (!arg_sep_len) { arg_sep = HTTP_URL_ARGSEP_DEFAULT; } @@ -992,6 +992,7 @@ PHP_FUNCTION(http_test) { + RETURN_TRUE; } /*

« previous php.pecl.cvs (#2898) next »