Commit 6cfaf59b authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #54 in ZP/z-push from...

Merge pull request #54 in ZP/z-push from bugfix/ZP-701-logging-binary-can-cause-out-of-memory to develop

* commit '9904f3bc':
  ZP-701 Truncate content on binary output log. Released under the Affero GNU General Public License (AGPL) version 3.
parents d549c7ba 9904f3bc
......@@ -336,6 +336,12 @@ class WBXMLEncoder extends WBXMLDefs {
private function outTermStr($content) {
fwrite($this->_out, $content);
fwrite($this->_out, chr(0));
// truncate data bigger than 10 KB on outLog
$l = strlen($content);
if ($l > 10240) {
$content = substr($content, 0, 5120) . sprintf("...<data with total %d bytes truncated>...", $l) . substr($content, -5120);
}
fwrite($this->_outLog, $content);
fwrite($this->_outLog, chr(0));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment