File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace BitApps \WPKit \Configs ;
4+
5+ final class JsonConfig
6+ {
7+ protected static $ decodeAsArray = true ;
8+
9+ public static function setDecodeAsArray ($ value )
10+ {
11+ static ::$ decodeAsArray = $ value ;
12+ }
13+
14+ public static function decodeAsArray ()
15+ {
16+ return static ::$ decodeAsArray ;
17+ }
18+ }
Original file line number Diff line number Diff line change 33namespace BitApps \WPKit \Http \Request ;
44
55use ArrayAccess ;
6+ use BitApps \WPKit \Configs \JsonConfig ;
67use BitApps \WPKit \Helpers \Arr ;
78use BitApps \WPKit \Helpers \JSON ;
89use BitApps \WPKit \Http \IpTool ;
@@ -239,7 +240,7 @@ protected function setBody($body = [])
239240 strpos ($ this ->contentType (), 'form-data ' ) === false
240241 && strpos ($ this ->contentType (), 'x-www-form-urlencoded ' ) === false
241242 ) {
242- $ this ->body = JSON ::maybeDecode (file_get_contents ('php://input ' ));
243+ $ this ->body = JSON ::maybeDecode (file_get_contents ('php://input ' ), JsonConfig:: decodeAsArray () );
243244 }
244245
245246 if (!empty ($ _POST )) {
You can’t perform that action at this time.
0 commit comments