PluginProbe
Media Cloud Sync / 1.4.1
Media Cloud Sync v1.4.1
1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 All 35 releases
← All changes | includes/sdk/s3/Aws/Api/Parser/QueryParser.php +7 -2 1.2.131.4.1 View file →
@@ -22,9 +22,9 @@
22 22 * @param bool $honorResultWrapper Set to false to disable the peeling
23 23 * back of result wrappers from the
24 24 * output structure.
25 25 */
26 - public function __construct(Service $api, XmlParser $xmlParser = null, $honorResultWrapper = \true)
26 + public function __construct(Service $api, ?XmlParser $xmlParser = null, $honorResultWrapper = \true)
27 27 {
28 28 parent::__construct($api);
29 29 $this->parser = $xmlParser ?: new XmlParser();
30 30 $this->honorResultWrapper = $honorResultWrapper;
@@ -31,9 +31,14 @@
31 31 }
32 32 public function __invoke(CommandInterface $command, ResponseInterface $response)
33 33 {
34 34 $output = $this->api->getOperation($command->getName())->getOutput();
35 - $xml = $this->parseXml($response->getBody(), $response);
35 + $body = $response->getBody();
36 + $xml = !$body->isSeekable() || $body->getSize() ? $this->parseXml($body, $response) : null;
37 + // Empty request bodies should not be deserialized.
38 + if (\is_null($xml)) {
39 + return new Result();
40 + }
36 41 if ($this->honorResultWrapper && $output['resultWrapper']) {
37 42 $xml = $xml->{$output['resultWrapper']};
38 43 }
39 44 return new Result($this->parser->parse($output, $xml));