summaryrefslogtreecommitdiff
path: root/ext/curl
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2008-07-01 08:10:47 +0000
committerAntony Dovgal <tony2001@php.net>2008-07-01 08:10:47 +0000
commitf5d82e28ce357ba53f2a4d91b9aa4af35c98fd1c (patch)
tree751347644d54459a545d095b5685503415fa9676 /ext/curl
parent5389a44a0595bd6bba3a673feb40e321ff8c28c9 (diff)
downloadphp-git-f5d82e28ce357ba53f2a4d91b9aa4af35c98fd1c.tar.gz
fix curl_init()
"s" in HEAD accepts zstr
Diffstat (limited to 'ext/curl')
-rw-r--r--ext/curl/interface.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 395fcb1803..b2f3cbeb35 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1089,17 +1089,17 @@ PHP_FUNCTION(curl_init)
{
php_curl *ch;
CURL *cp;
- char *src = NULL;
+ zstr src = NULL_ZSTR;
int src_len;
zend_uchar src_type;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|t", &src, &src_len, &src_type) == FAILURE) {
- RETURN_FALSE;
- }
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|t", &src, &src_len, &src_type) == FAILURE) {
+ RETURN_FALSE;
+ }
- if (src && src_type == IS_UNICODE) {
- src = zend_unicode_to_ascii((UChar*)src, src_len TSRMLS_CC);
- if (!src) {
+ if (src.v && src_type == IS_UNICODE) {
+ src.s = zend_unicode_to_ascii((UChar*)src.u, src_len TSRMLS_CC);
+ if (!src.s) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Binary or ASCII-Unicode string expected, non-ASCII-Unicode string received");
RETURN_FALSE;
}
@@ -1139,10 +1139,10 @@ PHP_FUNCTION(curl_init)
curl_easy_setopt(ch->cp, CURLOPT_NOSIGNAL, 1);
#endif
- if (src) {
+ if (src.v) {
char *urlcopy;
- urlcopy = estrndup(src, src_len);
+ urlcopy = estrndup(src.s, src_len);
curl_easy_setopt(ch->cp, CURLOPT_URL, urlcopy);
zend_llist_add_element(&ch->to_free.str, &urlcopy);
}