Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

+22 -11
View File
@@ -99,7 +99,7 @@ class _Amazon extends \IPS\File
static::$updatedEndpoint = NULL;
}
if ( ! $values['toggle'] )
if ( empty( $values['toggle'] ) )
{
$values['custom_url'] = NULL;
}
@@ -554,10 +554,12 @@ class _Amazon extends \IPS\File
$r = static::makeRequest( $path, 'POST', $this->configuration, $this->configurationId, NULL, NULL, FALSE, FALSE, array( 'uploads' => '' ) );
$uploadId = (string) $r->decodeXml()->UploadId;
return array(
'path' => $path,
'uploadId' => $uploadId
'path' => $path,
'uploadId' => $uploadId,
'final' => $path,
'original' => $this->originalFilename
);
}
@@ -584,15 +586,16 @@ class _Amazon extends \IPS\File
return $ref;
}
/**
* Finalize a chunked upload
*
* @param mixed $ref The reference for this upload as returned by chunkInit()
* @return string The file's reference which can be passed to \IPS\File::get() as the URL
* @throws \RuntimeException
* @param array $ref The reference for this upload as returned by chunkInit()
* @param string $storageConfiguration Storage configuration name
* @return \IPS\File The file object just created
* @throws \RuntimeException
*/
public function chunkFinish( $ref )
public function chunkFinish( array $ref, string $storageConfiguration ): \IPS\File
{
$xml = \IPS\Xml\SimpleXML::create( 'CompleteMultipartUpload', 'http://s3.amazonaws.com/doc/2006-03-01/' );
foreach ( $ref['etags'] as $partNumber => $eTag )
@@ -601,10 +604,18 @@ class _Amazon extends \IPS\File
$part->addChild( 'ETag', $eTag );
$part->addChild( 'PartNumber', $partNumber );
}
static::makeRequest( $ref['path'], 'POST', $this->configuration, $this->configurationId, $xml->asXML(), NULL, FALSE, NULL, array( 'uploadId' => $ref['uploadId'] ) );
return $ref['path'];
$fileObj = \IPS\File::get( $storageConfiguration, $ref['final'] );
/* This isn't preserved for chunk uploads, so we need to set it so apps can get the real value */
if ( !empty( $ref['original'] ) )
{
$fileObj->originalFilename = $ref['original'];
}
return $fileObj;
}
/**