Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 101 lines (88 sloc) 3.54 kb
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
1 /*
2 +----------------------------------------------------------------------+
dbeb415 @andigutmans - A belated happy holidays and PHP 5
andigutmans authored
3 | PHP Version 5 |
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
4 +----------------------------------------------------------------------+
16cb1cd sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php
Sebastian Bergmann authored
5 | Copyright (c) 1997-2010 The PHP Group |
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
6 +----------------------------------------------------------------------+
5bd9322 bump year and license version
foobar authored
7 | This source file is subject to version 3.01 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 |
f68c7ff updating license information in the headers.
James Cox authored
9 | available through the world-wide-web at the following url: |
5bd9322 bump year and license version
foobar authored
10 | http://www.php.net/license/3_01.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 POS…
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 {
f932fe5 Fixed bug #41293 (Fixed creation of HTTP_RAW_POST_DATA when there is no
Ilia Alshanetsky authored
40 char *data;
41 int length;
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
42
7f48a6f MFB
foobar authored
43 /* $HTTP_RAW_POST_DATA registration */
f932fe5 Fixed bug #41293 (Fixed creation of HTTP_RAW_POST_DATA when there is no
Ilia Alshanetsky authored
44 if (!strcmp(SG(request_info).request_method, "POST")) {
45 if (NULL == SG(request_info).post_entry) {
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
46 /* no post handler registered, so we just swallow the data */
47 sapi_read_standard_form_data(TSRMLS_C);
f932fe5 Fixed bug #41293 (Fixed creation of HTTP_RAW_POST_DATA when there is no
Ilia Alshanetsky authored
48 }
49
420352d Register RAW_POST_DATA even when always_populate_raw_post_data is off in
Ilia Alshanetsky authored
50 /* For unknown content types we create HTTP_RAW_POST_DATA even if always_populate_raw_post_data off,
51 * this is in-effecient, but we need to keep doing it for BC reasons (for now) */
52 if ((PG(always_populate_raw_post_data) || NULL == SG(request_info).post_entry) && SG(request_info).post_data) {
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
53 length = SG(request_info).post_data_length;
54 data = estrndup(SG(request_info).post_data, length);
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 */
f932fe5 Fixed bug #41293 (Fixed creation of HTTP_RAW_POST_DATA when there is no
Ilia Alshanetsky authored
65 if (SG(request_info).post_data) {
be5e379 HTTP_RAW_POST_DATA BC fixes
Hartmut Holzgraefe authored
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 }
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
69 }
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
70 /* }}} */
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
71
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
72 /* {{{ php_startup_sapi_content_types
73 */
0d78453 - Fix bug #28568 (known_post_content_types is not thread safe).
Moriyoshi Koizumi authored
74 int php_startup_sapi_content_types(TSRMLS_D)
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
75 {
98d95dd @zsuraski - Added support for unknown POST content types (Zeev)
zsuraski authored
76 sapi_register_default_post_reader(php_default_post_reader);
7527bf0 made sapi_register_treat_data() to support multibyte input encoding t…
Rui Hirokawa authored
77 sapi_register_treat_data(php_default_treat_data);
7429c2d @rlerdorf Input Filter support. See README.input_filter for details.
rlerdorf authored
78 sapi_register_input_filter(php_default_input_filter);
13e6764 @zsuraski Generalize SAPI a bit
zsuraski authored
79 return SUCCESS;
80 }
81e2cf0 @rlerdorf Fix folding and clean up some extensions
rlerdorf authored
81 /* }}} */
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
82
5e33c04 - Fixed bug #32109 ($_POST is not populated in multithreaded environm…
Moriyoshi Koizumi authored
83 /* {{{ php_setup_sapi_content_types
84 */
85 int php_setup_sapi_content_types(TSRMLS_D)
86 {
87 sapi_register_post_entries(php_post_entries TSRMLS_CC);
88
89 return SUCCESS;
90 }
91 /* }}} */
92
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
93 /*
94 * Local variables:
95 * tab-width: 4
96 * c-basic-offset: 4
97 * End:
78747bd - Don't wrap lines... this is annoying while coding.
Derick Rethans authored
98 * vim600: sw=4 ts=4 fdm=marker
99 * vim<600: sw=4 ts=4
ebd9e89 @rlerdorf Clean up EXIF code and give up on extracting the embedded thumbnail for
rlerdorf authored
100 */
Something went wrong with that request. Please try again.