Version 4.1.2
This commit is contained in:
1 parent
3ba79295ee
commit
28bd025b35
1131 files changed
+63658
-20579
No files matched your search
@@ -88,20 +88,21 @@ class _Upload extends FormAbstract
|
||||
|
||||
if( (float) ini_get('upload_max_filesize') > 0 )
|
||||
{
|
||||
$potentialValues[] = (float) ini_get('upload_max_filesize');
|
||||
$potentialValues[] = \IPS\File::returnBytes( ini_get('upload_max_filesize') );
|
||||
}
|
||||
|
||||
if( (float) ini_get('post_max_size') > 0 )
|
||||
{
|
||||
$potentialValues[] = (float) ini_get('post_max_size');
|
||||
$potentialValues[] = \IPS\File::returnBytes( ini_get('post_max_size') ) - 1048576;
|
||||
}
|
||||
|
||||
if( (float) ini_get('memory_limit') > 0 )
|
||||
{
|
||||
$potentialValues[] = (float) ini_get('memory_limit');
|
||||
$potentialValues[] = \IPS\File::returnBytes( ini_get('memory_limit') );
|
||||
}
|
||||
|
||||
$this->maxChunkSize = min( $potentialValues );
|
||||
/* We want the value in MB */
|
||||
$this->maxChunkSize = min( $potentialValues ) / 1048576;
|
||||
|
||||
/* Call parent constructor */
|
||||
call_user_func_array( 'parent::__construct', func_get_args() );
|
||||
@@ -388,7 +389,7 @@ class _Upload extends FormAbstract
|
||||
{
|
||||
/* Get the files we had already */
|
||||
$return = array();
|
||||
$tempFiles = iterator_to_array( \IPS\Db::i()->select( 'id,contents', 'core_files_temp', array( 'upload_key=?', md5( $this->name . session_id() ) ) )->setKeyField('id')->setValueField('contents') );
|
||||
$tempFiles = iterator_to_array( \IPS\Db::i()->select( 'id,contents,filename', 'core_files_temp', array( 'upload_key=?', md5( $this->name . session_id() ) ) )->setKeyField('id') );
|
||||
if ( $this->options['storageExtension'] )
|
||||
{
|
||||
$existingName = $this->name . '_existing';
|
||||
@@ -402,8 +403,10 @@ class _Upload extends FormAbstract
|
||||
{
|
||||
if ( $tempId and isset( $tempFiles[ $tempId ] ) )
|
||||
{
|
||||
$file = \IPS\File::get( $this->options['storageExtension'], $tempFiles[ $tempId ] );
|
||||
$file = \IPS\File::get( $this->options['storageExtension'], $tempFiles[ $tempId ]['contents'] );
|
||||
$file->tempId = $tempId;
|
||||
/* Reset the original filename to the real file name as $this->originalFilename is generated from the now AWS-safe $this->filename */
|
||||
$file->originalFilename = $tempFiles[ $tempId ]['filename'];
|
||||
$return[ $id ] = $file;
|
||||
}
|
||||
else
|
||||
@@ -429,7 +432,7 @@ class _Upload extends FormAbstract
|
||||
|
||||
try
|
||||
{
|
||||
\IPS\File::get( $this->options['storageExtension'], $tempFiles[ $tempId ] )->delete();
|
||||
\IPS\File::get( $this->options['storageExtension'], $tempFiles[ $tempId ]['contents'] )->delete();
|
||||
}
|
||||
catch ( \Exception $e ) { }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user