XML-RPC: Send 405 Method Not Allowed for GET requests.

props maxcutler.
fixes #20986.


git-svn-id: https://develop.svn.wordpress.org/trunk@31004 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-12-30 20:40:50 +00:00
parent e85543f68b
commit 869798d915
1 changed files with 5 additions and 1 deletions

View File

@ -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.');
}