Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 30 lines (22 sloc) 0.739 kb
13e6764 Zeev Suraski Generalize SAPI a bit
zsuraski authored
1 #include "php.h"
2 #include "SAPI.h"
3 #include "rfc1867.h"
4
d9a8628 Fix some warnings
Sascha Schumann authored
5 #include "php_content_types.h"
6
13e6764 Zeev Suraski Generalize SAPI a bit
zsuraski authored
7 static sapi_post_content_type_reader php_post_content_types[] = {
8 { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, rfc1867_post_reader },
9 { NULL, 0, NULL }
98d95dd Zeev Suraski - Added support for unknown POST content types (Zeev)
zsuraski authored
10 };
11
12
13 SAPI_POST_READER_FUNC(php_default_post_reader)
14 {
601b837 SET_VAR_STR* expect a emalloc'ed copy of the string!
Thies C. Arntzen authored
15 char *data;
98d95dd Zeev Suraski - Added support for unknown POST content types (Zeev)
zsuraski authored
16 ELS_FETCH();
17
18 sapi_read_standard_form_data(content_type_dup SLS_CC);
601b837 SET_VAR_STR* expect a emalloc'ed copy of the string!
Thies C. Arntzen authored
19 data = estrndup(SG(request_info).post_data,SG(request_info).post_data_length);
20 SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, SG(request_info).post_data_length);
13e6764 Zeev Suraski Generalize SAPI a bit
zsuraski authored
21 }
22
98d95dd Zeev Suraski - Added support for unknown POST content types (Zeev)
zsuraski authored
23
d9a8628 Fix some warnings
Sascha Schumann authored
24 int php_startup_SAPI_content_types(void)
13e6764 Zeev Suraski Generalize SAPI a bit
zsuraski authored
25 {
26 sapi_register_post_readers(php_post_content_types);
98d95dd Zeev Suraski - Added support for unknown POST content types (Zeev)
zsuraski authored
27 sapi_register_default_post_reader(php_default_post_reader);
13e6764 Zeev Suraski Generalize SAPI a bit
zsuraski authored
28 return SUCCESS;
29 }
Something went wrong with that request. Please try again.