[wp-trac] [WordPress Trac] #27447: 'XML-RPC server accepts POST requests only.' returned by xml-rpc.php while doing_wp_cron.

WordPress Trac noreply at wordpress.org
Tue Mar 18 19:01:57 UTC 2014


#27447: 'XML-RPC server accepts POST requests only.' returned by xml-rpc.php while
doing_wp_cron.
--------------------------+-----------------------------
 Reporter:  sduval        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  XML-RPC       |    Version:  3.8.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 While using ALTERNATE_WP_CRON, there is a redirect to a modified url
 including doing_wp_cron whenever a cron must be performed.

 A condition prevents the redirection from happening on POST, but when an
 xmlrpc is posted, the guard (!empty($_POST)) fails to prevent the
 redirection because the content does not get parsed into $_POST.

 In cron.php, spawn_cron, I propose replacing
 {{{
 function spawn_cron( $gmt_time = 0 ) {
 ...
         if ( defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON ) {

                 if ( !empty($_POST) || defined('DOING_AJAX') )
                     return;
 }}}

 by

 {{{
 function spawn_cron( $gmt_time = 0 ) {
 ...
         if ( defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON ) {

                 if ( 'POST' == $_SERVER['REQUEST_METHOD'] ||
 defined('DOING_AJAX') )
                     return;
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27447>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list