|
@@ 4788-4794 (lines=7) @@
|
| 4785 |
|
// are known to work with signature verification. A different method |
| 4786 |
|
// can be passed to the WP REST API via the '?_method=' parameter if |
| 4787 |
|
// needed. |
| 4788 |
|
if ( $_SERVER['REQUEST_METHOD'] !== 'GET' && $_SERVER['REQUEST_METHOD'] !== 'POST' ) { |
| 4789 |
|
return new WP_Error( |
| 4790 |
|
'rest_invalid_request', |
| 4791 |
|
'This request method is not supported.', |
| 4792 |
|
array( 'status' => 400 ) |
| 4793 |
|
); |
| 4794 |
|
} |
| 4795 |
|
if ( $_SERVER['REQUEST_METHOD'] !== 'POST' && ! empty( $this->HTTP_RAW_POST_DATA ) ) { |
| 4796 |
|
return new WP_Error( |
| 4797 |
|
'rest_invalid_request', |
|
@@ 4802-4812 (lines=11) @@
|
| 4799 |
|
array( 'status' => 400 ) |
| 4800 |
|
); |
| 4801 |
|
} |
| 4802 |
|
if ( |
| 4803 |
|
isset( $_SERVER['CONTENT_TYPE'] ) && |
| 4804 |
|
$_SERVER['CONTENT_TYPE'] !== 'application/x-www-form-urlencoded' && |
| 4805 |
|
$_SERVER['CONTENT_TYPE'] !== 'application/json' |
| 4806 |
|
) { |
| 4807 |
|
return new WP_Error( |
| 4808 |
|
'rest_invalid_request', |
| 4809 |
|
'This Content-Type is not supported.', |
| 4810 |
|
array( 'status' => 400 ) |
| 4811 |
|
); |
| 4812 |
|
} |
| 4813 |
|
|
| 4814 |
|
$verified = $this->verify_xml_rpc_signature(); |
| 4815 |
|
|