Closed
Description
ChainEncoder#getEncoder
method reads:
if (isset($this->encoderByFormat[$format])
&& isset($this->encoders[$this->encoderByFormat[$format]])
) {
return $this->encoders[$this->encoderByFormat[$format]];
}
foreach ($this->encoders as $i => $encoder) {
if ($encoder->supportsEncoding($format, $context)) {
$this->encoderByFormat[$format] = $i;
return $encoder;
}
}
If that method is called more than once with different $context
arguments the wrong encoder could be returned because $encoder->supportsEncoding($format, $context)
is not called again.
Hence, I disabled the first check and return
statement and things worked like a charm.