Make WordPress Core

Changeset 31004


Ignore:
Timestamp:
12/30/2014 08:40:50 PM (9 years ago)
Author:
nacin
Message:

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

props maxcutler.
fixes #20986.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-IXR.php

    r30744 r31004  
    403403        if (!$data) {
    404404            if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') {
    405                 header('Content-Type: text/plain'); // merged from WP #9093
     405                if ( function_exists( 'status_header' ) ) {
     406                    status_header( 405 ); // WP #20986
     407                    header( 'Allow: POST' );
     408                }
     409                header('Content-Type: text/plain'); // merged from WP #9093
    406410                die('XML-RPC server accepts POST requests only.');
    407411            }
Note: See TracChangeset for help on using the changeset viewer.