XML-RPC: Send 405 Method Not Allowed for GET requests.
props maxcutler. fixes #20986. Built from https://develop.svn.wordpress.org/trunk@31004 git-svn-id: http://core.svn.wordpress.org/trunk@30985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
95dba4c8c0
commit
504eb9aa0d
|
@ -402,7 +402,11 @@ class IXR_Server
|
|||
{
|
||||
if (!$data) {
|
||||
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
header('Content-Type: text/plain'); // merged from WP #9093
|
||||
if ( function_exists( 'status_header' ) ) {
|
||||
status_header( 405 ); // WP #20986
|
||||
header( 'Allow: POST' );
|
||||
}
|
||||
header('Content-Type: text/plain'); // merged from WP #9093
|
||||
die('XML-RPC server accepts POST requests only.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue