Changeset 1153

Show
Ignore:
Timestamp:
06/14/07 14:38:39 (1 year ago)
Author:
sven
Message:

rpc - work around php 5.2.2 bug (http://bugs.php.net/bug.php?id=41293)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/units/rpc/lib/IXR_Library.inc.php

    r758 r1153  
    288288        if (!$data) { 
    289289            global $HTTP_RAW_POST_DATA; 
    290             if (!$HTTP_RAW_POST_DATA) { 
    291                die('XML-RPC server accepts POST requests only.'); 
    292             } 
    293             $data = $HTTP_RAW_POST_DATA; 
     290            // CHANGE FROM UPSTREAM START - http://bugs.php.net/bug.php?id=41293 
     291            if (isset($HTTP_RAW_POST_DATA)) { 
     292                $input = $HTTP_RAW_POST_DATA; 
     293            } else { 
     294                $input = implode("\r\n", file('php://input')); 
     295            } 
     296            if (empty($input)) { 
     297                error_log('XML-RPC server accepts POST requests only.'); 
     298                die('XML-RPC server accepts POST requests only.'); 
     299            } 
     300            $data = $input; 
     301            // CHANGE FROM UPSTREAM END 
    294302        } 
    295303        $this->message = new IXR_Message($data);