Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 93 lines (82 sloc) 3.312 kb
ebd9e89 Rasmus Lerdorf 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 Rasmus Lerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
4 +----------------------------------------------------------------------+
2c5d4b8 Bump year.
Sebastian Bergmann authored
5 | Copyright (c) 1997-2003 The PHP Group |
ebd9e89 Rasmus Lerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
6 +----------------------------------------------------------------------+
f68c7ff updating license information in the headers.
James Cox authored
7 | This source file is subject to version 3.0 of the PHP license, |
ebd9e89 Rasmus Lerdorf 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 |
f68c7ff updating license information in the headers.
James Cox authored
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_0.txt. |
ebd9e89 Rasmus Lerdorf 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 Rasmus Lerdorf 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 Zeev Suraski 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 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
27 /* {{{ php_post_entries[]
28 */
a6393de Zeev Suraski 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 Zeev Suraski - Added support for unknown POST content types (Zeev)
zsuraski authored
33 };
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
34 /* }}} */
98d95dd Zeev Suraski - Added support for unknown POST content types (Zeev)
zsuraski authored
35
81e2cf0 Rasmus Lerdorf 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 Zeev Suraski - 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 Zeev Suraski - Added support for unknown POST content types (Zeev)
zsuraski authored
42
7f48a6f MFB
foobar 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 Zeev Suraski Generalize SAPI a bit
zsuraski authored
70 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
71 /* }}} */
13e6764 Zeev Suraski Generalize SAPI a bit
zsuraski authored
72
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
73 /* {{{ php_startup_sapi_content_types
74 */
a6393de Zeev Suraski 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 Zeev Suraski Generalize SAPI a bit
zsuraski authored
76 {
a6393de Zeev Suraski 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 Zeev Suraski - 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);
7429c2d Rasmus Lerdorf Input Filter support. See README.input_filter for details.
rlerdorf authored
80 sapi_register_input_filter(php_default_input_filter);
13e6764 Zeev Suraski Generalize SAPI a bit
zsuraski authored
81 return SUCCESS;
82 }
81e2cf0 Rasmus Lerdorf Fix folding and clean up some extensions
rlerdorf authored
83 /* }}} */
ebd9e89 Rasmus Lerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
84
85 /*
86 * Local variables:
87 * tab-width: 4
88 * c-basic-offset: 4
89 * End:
78747bd - Don't wrap lines... this is annoying while coding.
Derick Rethans authored
90 * vim600: sw=4 ts=4 fdm=marker
91 * vim<600: sw=4 ts=4
ebd9e89 Rasmus Lerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
92 */
Something went wrong with that request. Please try again.