diff options
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r-- | ext/standard/url.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c index 3b9b22af90..60ce808f4e 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -186,10 +186,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) } if (pp - p > 0 && pp - p < 6 && (*pp == '/' || *pp == '\0')) { - long port; + zend_long port; memcpy(port_buf, p, (pp - p)); port_buf[pp - p] = '\0'; - port = strtol(port_buf, NULL, 10); + port = ZEND_STRTOL(port_buf, NULL, 10); if (port > 0 && port <= 65535) { ret->port = (unsigned short) port; } else { @@ -280,10 +280,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) efree(ret); return NULL; } else if (e - p > 0) { - long port; + zend_long port; memcpy(port_buf, p, (e - p)); port_buf[e - p] = '\0'; - port = strtol(port_buf, NULL, 10); + port = ZEND_STRTOL(port_buf, NULL, 10); if (port > 0 && port <= 65535) { ret->port = (unsigned short)port; } else { @@ -375,9 +375,9 @@ end: PHP_FUNCTION(parse_url) { char *str; - int str_len; + size_t str_len; php_url *resource; - long key = -1; + zend_long key = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, &key) == FAILURE) { return; @@ -416,7 +416,7 @@ PHP_FUNCTION(parse_url) if (resource->fragment != NULL) RETVAL_STRING(resource->fragment); break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier %ld", key); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key); RETVAL_FALSE; } goto done; @@ -494,7 +494,7 @@ PHPAPI zend_string *php_url_encode(char const *s, int len) from = (unsigned char *)s; end = (unsigned char *)s + len; - start = STR_ALLOC(3 * len, 0); + start = zend_string_alloc(3 * len, 0); to = (unsigned char*)start->val; while (from < end) { @@ -525,7 +525,7 @@ PHPAPI zend_string *php_url_encode(char const *s, int len) } *to = '\0'; - start = STR_REALLOC(start, to - (unsigned char*)start->val, 0); + start = zend_string_realloc(start, to - (unsigned char*)start->val, 0); return start; } @@ -567,7 +567,7 @@ PHP_FUNCTION(urldecode) ZEND_PARSE_PARAMETERS_END(); #endif - out_str = STR_INIT(in_str->val, in_str->len, 0); + out_str = zend_string_init(in_str->val, in_str->len, 0); out_str->len = php_url_decode(out_str->val, out_str->len); RETURN_NEW_STR(out_str); @@ -612,7 +612,7 @@ PHPAPI zend_string *php_raw_url_encode(char const *s, int len) register int x, y; zend_string *str; - str = STR_ALLOC(3 * len, 0); + str = zend_string_alloc(3 * len, 0); for (x = 0, y = 0; len--; x++, y++) { str->val[y] = (unsigned char) s[x]; #ifndef CHARSET_EBCDIC @@ -632,7 +632,7 @@ PHPAPI zend_string *php_raw_url_encode(char const *s, int len) } } str->val[y] = '\0'; - str = STR_REALLOC(str, y, 0); + str = zend_string_realloc(str, y, 0); return str; } @@ -674,7 +674,7 @@ PHP_FUNCTION(rawurldecode) ZEND_PARSE_PARAMETERS_END(); #endif - out_str = STR_INIT(in_str->val, in_str->len, 0); + out_str = zend_string_init(in_str->val, in_str->len, 0); out_str->len = php_raw_url_decode(out_str->val, out_str->len); RETURN_NEW_STR(out_str); @@ -714,12 +714,12 @@ PHPAPI int php_raw_url_decode(char *str, int len) PHP_FUNCTION(get_headers) { char *url; - int url_len; + size_t url_len; php_stream_context *context; php_stream *stream; zval *prev_val, *hdr = NULL, *h; HashTable *hashT; - long format = 0; + zend_long format = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) { return; @@ -755,7 +755,7 @@ PHP_FUNCTION(get_headers) } if (!format) { no_name_header: - add_next_index_str(return_value, STR_COPY(Z_STR_P(hdr))); + add_next_index_str(return_value, zend_string_copy(Z_STR_P(hdr))); } else { char c; char *s, *p; |