X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_url_api.c;h=459b618b532f551ffbdb73790999b816d5644975;hp=8788064bfa26e13caa85555193060a407c40c8cb;hb=cf9967800843ea01e77b374b4d78fad4bc18a3f6;hpb=6a9c33f395f4293eb122c6e884a35c0153537446 diff --git a/http_url_api.c b/http_url_api.c index 8788064..459b618 100644 --- a/http_url_api.c +++ b/http_url_api.c @@ -59,13 +59,12 @@ PHP_HTTP_API char *_http_absolute_url_ex( if ((!url || !url_len) && ( (!(url = SG(request_info).request_uri)) || (!(url_len = strlen(SG(request_info).request_uri))))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "Cannot build an absolute URI if supplied URL and REQUEST_URI is empty"); + http_error(E_WARNING, HTTP_E_PARAM, "Cannot build an absolute URI if supplied URL and REQUEST_URI is empty"); return NULL; } if (!(purl = php_url_parse((char *) url))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not parse supplied URL"); + http_error_ex(E_WARNING, HTTP_E_PARSE, "Could not parse supplied URL: %s", url); return NULL; } @@ -116,7 +115,7 @@ PHP_HTTP_API char *_http_absolute_url_ex( #define HTTP_URI_STRLCATL(URL, full_len, add_string) HTTP_URI_STRLCAT(URL, full_len, add_string, strlen(add_string)) #define HTTP_URI_STRLCAT(URL, full_len, add_string, add_len) \ if ((full_len += add_len) > HTTP_URI_MAXLEN) { \ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, \ + http_error_ex(E_NOTICE, HTTP_E_URL, \ "Absolute URI would have exceeded max URI length (%d bytes) - " \ "tried to add %d bytes ('%s')", \ HTTP_URI_MAXLEN, add_len, add_string); \ @@ -195,7 +194,6 @@ PHP_HTTP_API STATUS _http_urlencode_hash_ex(HashTable *hash, zend_bool override_ } if (SUCCESS != http_urlencode_hash_implementation(hash, qstr, arg_sep)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't encode query data"); phpstr_free(qstr); return FAILURE; } @@ -222,6 +220,7 @@ PHP_HTTP_API STATUS _http_urlencode_hash_implementation_ex( zval **zdata = NULL, *copyzval; if (!ht || !formstr) { + http_error(E_WARNING, HTTP_E_PARAM, "Invalid parameters"); return FAILURE; } @@ -260,7 +259,7 @@ PHP_HTTP_API STATUS _http_urlencode_hash_implementation_ex( #endif 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."); + http_error(E_WARNING, HTTP_E_ENCODE, "Error traversing form data array."); return FAILURE; } if (Z_TYPE_PP(zdata) == IS_ARRAY || Z_TYPE_PP(zdata) == IS_OBJECT) {