Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 92 lines (81 sloc) 3.257 kb
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
1 /*
2 +----------------------------------------------------------------------+
3893351 Update headers.
Sebastian Bergmann authored
3 | PHP Version 4 |
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
4 +----------------------------------------------------------------------+
3893351 Update headers.
Sebastian Bergmann authored
5 | Copyright (c) 1997-2002 The PHP Group |
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
6 +----------------------------------------------------------------------+
a0e4652 @andigutmans - License is at 2.02
andigutmans authored
7 | This source file is subject to version 2.02 of the PHP license, |
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
8 | that is bundled with this package in the file LICENSE, and is |
9 | available at through the world-wide-web at |
0836e10 various version 2.0 and 2.01 licenses -> 2.02
David Croft authored
10 | http://www.php.net/license/2_02.txt. |
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
90613d2 Maintain headers.
Sebastian Bergmann authored
15 | Author: |
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
16 +----------------------------------------------------------------------+
0836e10 various version 2.0 and 2.01 licenses -> 2.02
David Croft authored
17 */
18
19 /* $Id$ */
20
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
21 #include "php.h"
22 #include "SAPI.h"
23 #include "rfc1867.h"
24
d9a8628 Fix some warnings
Sascha Schumann authored
25 #include "php_content_types.h"
26
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
27 /* {{{ php_post_entries[]
28 */
a6393de @zsuraski Make POST handling the way it should be. RFC1867, and any future POST h...
zsuraski authored
29 static sapi_post_entry php_post_entries[] = {
e46deca First step for chunkifying the HTTP uploads.
foobar authored
30 { DEFAULT_POST_CONTENT_TYPE, sizeof(DEFAULT_POST_CONTENT_TYPE)-1, sapi_read_standard_form_data, php_std_post_handler },
31 { MULTIPART_CONTENT_TYPE, sizeof(MULTIPART_CONTENT_TYPE)-1, NULL, rfc1867_post_handler },
32 { NULL, 0, NULL, NULL }
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
33 };
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
34 /* }}} */
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
35
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
36 /* {{{ SAPI_POST_READER_FUNC
37 */
0dab84d fix SAPI_POST_* exports
Daniel Beulshausen authored
38 SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader)
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
39 {
5aec6f4 fix for #20198:
Hartmut Holzgraefe authored
40 char *data = NULL;
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
41 int length = 0;
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
42
fd52bf2 Portability: In C sources, do not use C++ comments
Martin Kraemer authored
43 /* $HTTP_RAW_POST_DATA registration */
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
44 if(!strcmp(SG(request_info).request_method, "POST")) {
45 if(NULL == SG(request_info).post_entry) {
46 /* no post handler registered, so we just swallow the data */
47 sapi_read_standard_form_data(TSRMLS_C);
48 length = SG(request_info).post_data_length;
49 data = estrndup(SG(request_info).post_data, length);
50 } else if(PG(always_populate_raw_post_data) && SG(request_info).post_data) {
51 length = SG(request_info).post_data_length;
52 data = estrndup(SG(request_info).post_data, length);
5aec6f4 fix for #20198:
Hartmut Holzgraefe authored
53 }
54 if(data) {
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
55 SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length);
5aec6f4 fix for #20198:
Hartmut Holzgraefe authored
56 }
8b7e9d7 some changes to how request input data (Content-Lenght >0) is handled
Hartmut Holzgraefe authored
57 }
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
58
59 /* for php://input stream:
60 some post handlers modify the content of request_info.post_data
61 so for now we need a copy for the php://input stream
62 in the long run post handlers should be changed to not touch
63 request_info.post_data for memory preservation reasons
64 */
65 if(SG(request_info).post_data) {
66 SG(request_info).raw_post_data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length);
67 SG(request_info).raw_post_data_length = SG(request_info).post_data_length;
68 }
69
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
70 }
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
71 /* }}} */
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
72
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
73 /* {{{ php_startup_sapi_content_types
74 */
a6393de @zsuraski Make POST handling the way it should be. RFC1867, and any future POST h...
zsuraski authored
75 int php_startup_sapi_content_types(void)
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
76 {
a6393de @zsuraski Make POST handling the way it should be. RFC1867, and any future POST h...
zsuraski authored
77 sapi_register_post_entries(php_post_entries);
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
78 sapi_register_default_post_reader(php_default_post_reader);
7527bf0 made sapi_register_treat_data() to support multibyte input encoding tran...
Rui Hirokawa authored
79 sapi_register_treat_data(php_default_treat_data);
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
80 return SUCCESS;
81 }
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
82 /* }}} */
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
83
84 /*
85 * Local variables:
86 * tab-width: 4
87 * c-basic-offset: 4
88 * End:
78747bd - Don't wrap lines... this is annoying while coding.
Derick Rethans authored
89 * vim600: sw=4 ts=4 fdm=marker
90 * vim<600: sw=4 ts=4
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
91 */
Something went wrong with that request. Please try again.