WordPress.org

Make WordPress Core

Ticket #29957: class-IXR.diff

File class-IXR.diff, 913 bytes (added by ankit.gade@…, 7 years ago)

Filter added for setting value of $chunk_size

  • wp-includes/class-IXR.php

     
    241241        xml_set_object($this->_parser, $this);
    242242        xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
    243243        xml_set_character_data_handler($this->_parser, 'cdata');
    244         $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
     244
     245                /**
     246                 * Allows to set maximum memory that can be used to parse xml-rpc reponse message.
     247                 *
     248                 * @param int 262144 Default value of memory allotted.
     249                 */
     250        $chunk_size = apply_filters( 'xmlrpc_memory_limit', 262144 ); // 256Kb, parse in chunks to avoid the RAM usage on very large messages
    245251        $final = false;
    246252        do {
    247253            if (strlen($this->message) <= $chunk_size) {