ZEND_ARG_PASS_INFO(0)
ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO();
+
+static
+ZEND_BEGIN_ARG_INFO(http_request_info_ref_5, 0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(1)
+ZEND_END_ARG_INFO();
#else
static unsigned char http_request_info_ref_3[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE};
static unsigned char http_request_info_ref_4[] = {4, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE};
+static unsigned char http_request_info_ref_5[] = {5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE};
#endif /* ZEND_ENGINE_2 */
#endif /* HTTP_HAVE_CURL */
PHP_FE(http_get, http_request_info_ref_3)
PHP_FE(http_head, http_request_info_ref_3)
PHP_FE(http_post_data, http_request_info_ref_4)
- PHP_FE(http_post_array, http_request_info_ref_4)
+ PHP_FE(http_post_fields, http_request_info_ref_5)
#endif
PHP_FE(http_auth_basic, NULL)
PHP_FE(http_auth_basic_cb, NULL)
efree(HTTP_G(ctype));
HTTP_G(ctype) = NULL;
}
-
+
#ifdef HTTP_HAVE_CURL
# if LIBCURL_VERSION_NUM < 0x070c00
memset(&HTTP_G(curlerr), 0, sizeof(HTTP_G(curlerr)));
#define http_check_allowed_methods(m, l) _http_check_allowed_methods((m), (l) TSRMLS_CC)
static inline void _http_check_allowed_methods(char *methods, int length TSRMLS_DC)
{
- char *found, *header;
-
- if (!length || !SG(request_info).request_method) {
- return;
+ if (length && SG(request_info).request_method) {
+ if (SUCCESS != http_check_method_ex(SG(request_info).request_method, methods)) {
+ char *header = emalloc(length + sizeof("Allow: "));
+ sprintf(header, "Allow: %s", methods);
+ http_exit(405, header);
+ }
}
-
- if ( (found = strstr(methods, SG(request_info).request_method)) &&
- (found == SG(request_info).request_method || !isalpha(found[-1])) &&
- (!isalpha(found[strlen(SG(request_info).request_method) + 1]))) {
- return;
- }
-
- header = emalloc(length + sizeof("Allow: "));
- sprintf(header, "Allow: %s", methods);
- http_exit(405, header);
}
/* }}} */