X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_method_api.c;h=d9d3370c41c79f49fc14d54055f48293bced853d;hp=9e428d15ce9ff37960e69f786daad2cca2416a4e;hb=1d04e52e7a5fc759c906d17d3547e74df06c2131;hpb=dbc4ec02cd319000b5c8589910047cfe6d5738be diff --git a/http_request_method_api.c b/http_request_method_api.c index 9e428d1..d9d3370 100644 --- a/http_request_method_api.c +++ b/http_request_method_api.c @@ -109,7 +109,7 @@ PHP_RINIT_FUNCTION(http_request_method) zval **data; zend_hash_init(&methods, 0, NULL, ZVAL_PTR_DTOR, 0); - http_parse_params(HTTP_G->request.methods.custom.ini, &methods); + http_parse_params(HTTP_G->request.methods.custom.ini, HTTP_PARAMS_DEFAULT, &methods); FOREACH_HASH_VAL(pos, &methods, data) { if (Z_TYPE_PP(data) == IS_STRING) { http_request_method_register(Z_STRVAL_PP(data), Z_STRLEN_PP(data)); @@ -191,7 +191,7 @@ PHP_HTTP_API int _http_request_method_register(const char *method_name, int meth char *http_method, *method, *mconst; http_request_method_entry **ptr = HTTP_G->request.methods.custom.entries; - if (!isalpha(*method_name)) { + if (!HTTP_IS_CTYPE(alpha, *method_name)) { http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method does not start with a character (%s)", method_name); return 0; } @@ -211,13 +211,13 @@ PHP_HTTP_API int _http_request_method_register(const char *method_name, int meth break; default: - if (!isalnum(method_name[i])) { + if (!HTTP_IS_CTYPE(alnum, method_name[i])) { efree(method); efree(mconst); http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method contains illegal characters (%s)", method_name); return 0; } - mconst[i] = method[i] = toupper(method_name[i]); + mconst[i] = method[i] = HTTP_TO_CTYPE(upper, method_name[i]); break; } } @@ -260,7 +260,7 @@ PHP_HTTP_API STATUS _http_request_method_unregister(int method TSRMLS_DC) if ( (HTTP_CUSTOM_REQUEST_METHOD(method) < 0) || (HTTP_CUSTOM_REQUEST_METHOD(method) > HTTP_G->request.methods.custom.count) || (!ptr[HTTP_CUSTOM_REQUEST_METHOD(method)])) { - http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Custom request method with id %lu does not exist", method); + http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Custom request method with id %d does not exist", method); return FAILURE; }