Conditions | 5 |
Paths | 3 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | private function isRestRequest() { |
||
18 | |||
19 | if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { |
||
20 | return true; |
||
21 | } |
||
22 | |||
23 | // This is dirty, but no better way to detect before parse_request. |
||
24 | if ( ! empty( $_SERVER['REQUEST_URI'] ) && false !== stripos( $_SERVER['REQUEST_URI'], rest_get_url_prefix() ) ) { |
||
25 | return true; |
||
26 | } |
||
27 | |||
28 | return false; |
||
29 | } |
||
30 | |||
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.