| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
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;
}
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;
}
}
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;
}