wp/wp-includes/IXR/class-IXR-message.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 21 48c4eec2b7e6
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
   108          * @param int $chunk_size Chunk size to parse in bytes.
   108          * @param int $chunk_size Chunk size to parse in bytes.
   109          */
   109          */
   110         $chunk_size = apply_filters( 'xmlrpc_chunk_parsing_size', $chunk_size );
   110         $chunk_size = apply_filters( 'xmlrpc_chunk_parsing_size', $chunk_size );
   111 
   111 
   112         $final = false;
   112         $final = false;
       
   113 
   113         do {
   114         do {
   114             if (strlen($this->message) <= $chunk_size) {
   115             if (strlen($this->message) <= $chunk_size) {
   115                 $final = true;
   116                 $final = true;
   116             }
   117             }
       
   118 
   117             $part = substr($this->message, 0, $chunk_size);
   119             $part = substr($this->message, 0, $chunk_size);
   118             $this->message = substr($this->message, $chunk_size);
   120             $this->message = substr($this->message, $chunk_size);
       
   121 
   119             if (!xml_parse($this->_parser, $part, $final)) {
   122             if (!xml_parse($this->_parser, $part, $final)) {
       
   123                 xml_parser_free($this->_parser);
       
   124                 unset($this->_parser);
   120                 return false;
   125                 return false;
   121             }
   126             }
       
   127 
   122             if ($final) {
   128             if ($final) {
   123                 break;
   129                 break;
   124             }
   130             }
   125         } while (true);
   131         } while (true);
       
   132 
   126         xml_parser_free($this->_parser);
   133         xml_parser_free($this->_parser);
       
   134         unset($this->_parser);
   127 
   135 
   128         // Grab the error messages, if any
   136         // Grab the error messages, if any
   129         if ($this->messageType == 'fault') {
   137         if ($this->messageType == 'fault') {
   130             $this->faultCode = $this->params[0]['faultCode'];
   138             $this->faultCode = $this->params[0]['faultCode'];
   131             $this->faultString = $this->params[0]['faultString'];
   139             $this->faultString = $this->params[0]['faultString'];