From 8941648ead3f7f96d662625b8f2facd50e7cff25 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 13 Oct 2015 01:01:24 +0000 Subject: [PATCH] XML-RPC: Add a filter, `xmlrpc_memory_limit`, to allow the value of `$xmlrpc_memory_limit` to be increased. Props ankit.gade. Fixes #29957. Built from https://develop.svn.wordpress.org/trunk@35095 git-svn-id: http://core.svn.wordpress.org/trunk@35060 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-IXR.php | 13 ++++++++++++- wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index 7cc4c20fb9..9109cbd4d6 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -268,7 +268,18 @@ class IXR_Message xml_set_object($this->_parser, $this); xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); xml_set_character_data_handler($this->_parser, 'cdata'); - $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages + + // 256Kb, parse in chunks to avoid the RAM usage on very large messages + $xmlrpc_memory_limit = 262144; + /** + * Filter the maximum memory that can be used to parse an XML-RPC reponse message. + * + * @since 4.4.0 + * + * @param int $xmlrpc_memory_limit Default value of memory allotted. + */ + $chunk_size = apply_filters( 'xmlrpc_memory_limit', $xmlrpc_memory_limit ); + $final = false; do { if (strlen($this->message) <= $chunk_size) { diff --git a/wp-includes/version.php b/wp-includes/version.php index d77556dc69..e335b79e5d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35094'; +$wp_version = '4.4-alpha-35095'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.