wp/wp-includes/IXR/class-IXR-server.php
changeset 16 a86126ab1dd4
parent 7 cf61fcea0001
child 18 be944660c56a
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
    45                 }
    45                 }
    46                 header('Content-Type: text/plain'); // merged from WP #9093
    46                 header('Content-Type: text/plain'); // merged from WP #9093
    47                 die('XML-RPC server accepts POST requests only.');
    47                 die('XML-RPC server accepts POST requests only.');
    48             }
    48             }
    49 
    49 
    50             global $HTTP_RAW_POST_DATA;
    50             $data = file_get_contents('php://input');
    51             if (empty($HTTP_RAW_POST_DATA)) {
       
    52                 // workaround for a bug in PHP 5.2.2 - http://bugs.php.net/bug.php?id=41293
       
    53                 $data = file_get_contents('php://input');
       
    54             } else {
       
    55                 $data =& $HTTP_RAW_POST_DATA;
       
    56             }
       
    57         }
    51         }
    58         $this->message = new IXR_Message($data);
    52         $this->message = new IXR_Message($data);
    59         if (!$this->message->parse()) {
    53         if (!$this->message->parse()) {
    60             $this->error(-32700, 'parse error. not well formed');
    54             $this->error(-32700, 'parse error. not well formed');
    61         }
    55         }
   149         header('Connection: close');
   143         header('Connection: close');
   150         if ($charset)
   144         if ($charset)
   151             header('Content-Type: text/xml; charset='.$charset);
   145             header('Content-Type: text/xml; charset='.$charset);
   152         else
   146         else
   153             header('Content-Type: text/xml');
   147             header('Content-Type: text/xml');
   154         header('Date: '.date('r'));
   148         header('Date: '.gmdate('r'));
   155         echo $xml;
   149         echo $xml;
   156         exit;
   150         exit;
   157     }
   151     }
   158 
   152 
   159     function hasMethod($method)
   153     function hasMethod($method)