File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 4
4
$ _PATCH = array ();
5
5
6
6
$ request_method = isset ($ _SERVER ['REQUEST_METHOD ' ]) ? $ _SERVER ['REQUEST_METHOD ' ] : '' ;
7
+ $ content_type = isset ($ _SERVER ['CONTENT_TYPE ' ]) ? $ _SERVER ['CONTENT_TYPE ' ] : '' ;
7
8
$ data_values = $ _GET ;
8
9
if ($ request_method === 'POST ' ) {
9
10
$ data_values = $ _POST ;
10
11
}
11
12
else if ($ request_method === 'PUT ' ) {
12
- parse_str ($ http_raw_post_data , $ _PUT );
13
- $ data_values = $ _PUT ;
13
+ if (strpos ($ content_type , 'application/x-www-form-urlencoded ' ) === 0 ) {
14
+ parse_str ($ http_raw_post_data , $ _PUT );
15
+ $ data_values = $ _PUT ;
16
+ }
14
17
}
15
18
else if ($ request_method === 'PATCH ' ) {
16
- parse_str ($ http_raw_post_data , $ _PATCH );
17
- $ data_values = $ _PATCH ;
19
+ if (strpos ($ content_type , 'application/x-www-form-urlencoded ' ) === 0 ) {
20
+ parse_str ($ http_raw_post_data , $ _PATCH );
21
+ $ data_values = $ _PATCH ;
22
+ }
18
23
}
19
24
20
25
$ test = isset ($ _SERVER ['HTTP_X_DEBUG_TEST ' ]) ? $ _SERVER ['HTTP_X_DEBUG_TEST ' ] : '' ;
You can’t perform that action at this time.
0 commit comments