mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Enforce php.ini limits when not using CKEditor + jQuery File Upload
This commit is contained in:
parent
73d4ea842f
commit
d981b649c1
3 changed files with 18 additions and 1 deletions
|
|
@ -343,6 +343,7 @@
|
|||
var obj = {};
|
||||
obj.mid = window.current_mid;
|
||||
obj.editor_sequence = data.editorSequence;
|
||||
obj.allow_chunks = 'Y';
|
||||
|
||||
$.exec_json('file.getFileList', obj, function(res){
|
||||
data.uploadTargetSrl = res.upload_target_srl;
|
||||
|
|
|
|||
|
|
@ -326,6 +326,13 @@ class editorModel extends editor
|
|||
$file_config->allowed_filesize = min(FileHandler::returnBytes(ini_get('upload_max_filesize')), FileHandler::returnBytes(ini_get('post_max_size')));
|
||||
$file_config->allowed_chunk_size = 0;
|
||||
}
|
||||
|
||||
// Do not allow chunked uploads in XpressEditor.
|
||||
if (starts_with($option->skin, 'xpresseditor'))
|
||||
{
|
||||
$file_config->allowed_filesize = min(FileHandler::returnBytes(ini_get('upload_max_filesize')), FileHandler::returnBytes(ini_get('post_max_size')));
|
||||
$file_config->allowed_chunk_size = 0;
|
||||
}
|
||||
|
||||
Context::set('file_config',$file_config);
|
||||
// Configure upload status such as file size
|
||||
|
|
|
|||
|
|
@ -309,6 +309,15 @@ class fileModel extends file
|
|||
function getUploadStatus($attached_size = 0)
|
||||
{
|
||||
$file_config = $this->getUploadConfig();
|
||||
if (Context::get('allow_chunks') === 'Y')
|
||||
{
|
||||
$allowed_filesize = $file_config->allowed_filesize * 1024 * 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
$allowed_filesize = min(FileHandler::returnBytes(ini_get('upload_max_filesize')), FileHandler::returnBytes(ini_get('post_max_size')));
|
||||
}
|
||||
|
||||
// Display upload status
|
||||
$upload_status = sprintf(
|
||||
'%s : %s/ %s<br /> %s : %s (%s : %s)',
|
||||
|
|
@ -316,7 +325,7 @@ class fileModel extends file
|
|||
FileHandler::filesize($attached_size),
|
||||
FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
|
||||
lang('allowed_filesize'),
|
||||
FileHandler::filesize($file_config->allowed_filesize*1024*1024),
|
||||
FileHandler::filesize($allowed_filesize),
|
||||
lang('allowed_filetypes'),
|
||||
$file_config->allowed_filetypes
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue