Commit 51bb7e3d authored by Manfred Kutas's avatar Manfred Kutas

ZP-874 Warn in WBXMLencoder processMultipart() if stream has "no size".

Released under the Affero GNU General Public License (AGPL) version 3.
parent 220672cb
......@@ -508,10 +508,13 @@ class WBXMLEncoder extends WBXMLDefs {
fwrite($this->_out, pack("iii", ($nrBodyparts + 1), $blockstart, $len));
foreach ($this->bodyparts as $bp) {
foreach ($this->bodyparts as $i=>$bp) {
$blockstart = $blockstart + $len;
$len = fstat($bp);
$len = (isset($len['size'])) ? $len['size'] : 0;
if ($len == 0) {
ZLog::Write(LOGLEVEL_WARN, sprintf("WBXMLEncoder->processMultipart(): the length of the body part at position %d is 0", $i));
}
fwrite($this->_out, pack("ii", $blockstart, $len));
}
......
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