Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function handle() { |
||
35 | |||
36 | if ( ! $this->isRestRequest() ) { |
||
37 | return Handler::DONE; |
||
38 | } |
||
39 | |||
40 | $data = Formatter::formatExceptionAsDataArray( $this->getInspector(), $this->addTraceToOutput() ); |
||
|
|||
41 | $response = array( |
||
42 | 'code' => $data['type'], |
||
43 | 'message' => $data['message'], |
||
44 | 'data' => $data, |
||
45 | ); |
||
46 | |||
47 | if ( Misc::canSendHeaders() ) { |
||
48 | status_header( 500 ); |
||
49 | header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) ); |
||
50 | } |
||
51 | |||
52 | echo wp_json_encode( $response, JSON_PRETTY_PRINT ); |
||
53 | |||
54 | return Handler::QUIT; |
||
55 | } |
||
56 | } |
||
57 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.