- zval array;
- char *http_method, *method;
- ulong i, meth_num = HTTP_G(request).methods.custom.nNextFreeElement + HTTP_MAX_REQUEST_METHOD;
-
+ int i, meth_num;
+ char *http_method, *method, *mconst;
+ getGlobals(G);
+ http_request_method_entry **ptr = G->request.methods.custom.entries;
+
+ if (!isalpha(*method_name)) {
+ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method does not start with a character (%s)", method_name);
+ return 0;
+ }
+
+ if (http_request_method_exists(1, 0, method_name)) {
+ http_error_ex(HE_WARNING, HTTP_E_REQUEST_METHOD, "Request method does already exist (%s)", method_name);
+ return 0;
+ }
+