mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-11 19:08:49 +00:00
[s3_storage] Bump version of akeeba/s3 to version 2.3.1
- Address https://github.com/friendica/friendica/issues/12011#issuecomment-1854681792
This commit is contained in:
parent
9daa11eb10
commit
3e74af9775
61 changed files with 1472 additions and 708 deletions
30
s3_storage/vendor/akeeba/s3/src/Response.php
vendored
30
s3_storage/vendor/akeeba/s3/src/Response.php
vendored
|
@ -3,18 +3,18 @@
|
|||
* Akeeba Engine
|
||||
*
|
||||
* @package akeebaengine
|
||||
* @copyright Copyright (c)2006-2020 Nicholas K. Dionysopoulos / Akeeba Ltd
|
||||
* @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd
|
||||
* @license GNU General Public License version 3, or later
|
||||
*/
|
||||
|
||||
namespace Akeeba\Engine\Postproc\Connector\S3v4;
|
||||
namespace Akeeba\S3;
|
||||
|
||||
use Akeeba\Engine\Postproc\Connector\S3v4\Exception\PropertyNotFound;
|
||||
use Akeeba\Engine\Postproc\Connector\S3v4\Response\Error;
|
||||
use Akeeba\S3\Exception\PropertyNotFound;
|
||||
use Akeeba\S3\Response\Error;
|
||||
use SimpleXMLElement;
|
||||
|
||||
// Protection against direct access
|
||||
defined('AKEEBAENGINE') or die();
|
||||
defined('AKEEBAENGINE') || die();
|
||||
|
||||
/**
|
||||
* Amazon S3 API response object
|
||||
|
@ -124,7 +124,7 @@ class Response
|
|||
*
|
||||
* @param string|SimpleXMLElement|null $body
|
||||
*/
|
||||
public function setBody($body): void
|
||||
public function setBody($body, bool $rawResponse = false): void
|
||||
{
|
||||
$this->body = null;
|
||||
|
||||
|
@ -135,7 +135,7 @@ class Response
|
|||
|
||||
$this->body = $body;
|
||||
|
||||
$this->finaliseBody();
|
||||
$this->finaliseBody($rawResponse);
|
||||
}
|
||||
|
||||
public function resetBody(): void
|
||||
|
@ -153,7 +153,7 @@ class Response
|
|||
$this->body .= $data;
|
||||
}
|
||||
|
||||
public function finaliseBody(): void
|
||||
public function finaliseBody(bool $rawResponse = false): void
|
||||
{
|
||||
if (!$this->hasBody())
|
||||
{
|
||||
|
@ -165,8 +165,14 @@ class Response
|
|||
$this->headers['type'] = 'text/plain';
|
||||
}
|
||||
|
||||
if (is_string($this->body) &&
|
||||
(($this->headers['type'] == 'application/xml') || (substr($this->body, 0, 5) == '<?xml'))
|
||||
if (
|
||||
!$rawResponse
|
||||
&& is_string($this->body)
|
||||
&&
|
||||
(
|
||||
($this->headers['type'] == 'application/xml')
|
||||
|| (substr($this->body, 0, 5) == '<?xml')
|
||||
)
|
||||
)
|
||||
{
|
||||
$this->body = simplexml_load_string($this->body);
|
||||
|
@ -332,8 +338,8 @@ class Response
|
|||
)
|
||||
{
|
||||
$this->error = new Error(
|
||||
$this->code,
|
||||
(string) $this->body->Message
|
||||
500,
|
||||
(string) $this->body->Code . ':' . (string) $this->body->Message
|
||||
);
|
||||
|
||||
if (isset($this->body->Resource))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue