mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
NOISSUE PHP 버전 호환성 개선
This commit is contained in:
parent
cd1dfda2a2
commit
0ccf7bb6a8
7 changed files with 57 additions and 35 deletions
|
|
@ -114,7 +114,7 @@ class fileController extends file
|
|||
|
||||
if(FileHandler::createImageFile($source_src,$output_src,$width,$height,'','ratio'))
|
||||
{
|
||||
$output->info = getimagesize($output_src);
|
||||
$output->info = getimagesize($output_src);
|
||||
$output->src = $output_src;
|
||||
}
|
||||
else
|
||||
|
|
@ -122,7 +122,7 @@ class fileController extends file
|
|||
return new Object(-1,'msg_invalid_request');
|
||||
}
|
||||
|
||||
$this->add('resized_info',$output);
|
||||
$this->add('resized_info',$output);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -293,13 +293,13 @@ class fileController extends file
|
|||
$uploaded_filename = $file_obj->uploaded_filename;
|
||||
|
||||
if(!file_exists($uploaded_filename)) return $this->stop('msg_file_not_found');
|
||||
|
||||
|
||||
if(!$file_key || $_SESSION[$session_key][$file_srl] != $file_key)
|
||||
{
|
||||
unset($_SESSION[$session_key][$file_srl]);
|
||||
return $this->stop('msg_invalid_request');
|
||||
}
|
||||
|
||||
|
||||
$file_size = $file_obj->file_size;
|
||||
$filename = $file_obj->source_filename;
|
||||
if(strstr($_SERVER['HTTP_USER_AGENT'], "MSIE"))
|
||||
|
|
@ -321,13 +321,13 @@ class fileController extends file
|
|||
if(!$fp) return $this->stop('msg_file_not_found');
|
||||
|
||||
header("Cache-Control: ");
|
||||
header("Pragma: ");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Pragma: ");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
|
||||
header("Content-Length: " .(string)($file_size));
|
||||
header("Content-Length: " .(string)($file_size));
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||
header("Content-Transfer-Encoding: binary\n");
|
||||
header("Content-Transfer-Encoding: binary\n");
|
||||
|
||||
// if file size is lager than 10MB, use fread function (#18675748)
|
||||
if(filesize($uploaded_filename) > 1024 * 1024)
|
||||
|
|
@ -337,7 +337,7 @@ class fileController extends file
|
|||
}
|
||||
else
|
||||
{
|
||||
fpassthru($fp);
|
||||
fpassthru($fp);
|
||||
}
|
||||
|
||||
exit();
|
||||
|
|
@ -379,7 +379,7 @@ class fileController extends file
|
|||
$file_info = $output->data;
|
||||
if(!$file_info) continue;
|
||||
|
||||
$file_grant = $oFileModel->getFileGrant($file_info, $logged_info);
|
||||
$file_grant = $oFileModel->getFileGrant($file_info, $logged_info);
|
||||
|
||||
if(!$file_grant->is_deletable) continue;
|
||||
|
||||
|
|
@ -555,7 +555,7 @@ class fileController extends file
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the attachements of the upload_target_srl to be valid
|
||||
* Set the attachements of the upload_target_srl to be valid
|
||||
* By changing its state to valid when a document is inserted, it prevents from being considered as a unnecessary file
|
||||
*
|
||||
* @param int $upload_target_srl
|
||||
|
|
@ -602,6 +602,7 @@ class fileController extends file
|
|||
function insertFile($file_info, $module_srl, $upload_target_srl, $download_count = 0, $manual_insert = false)
|
||||
{
|
||||
// Call a trigger (before)
|
||||
$trigger_obj = new stdClass;
|
||||
$trigger_obj->module_srl = $module_srl;
|
||||
$trigger_obj->upload_target_srl = $upload_target_srl;
|
||||
$output = ModuleHandler::triggerCall('file.insertFile', 'before', $trigger_obj);
|
||||
|
|
@ -626,6 +627,7 @@ class fileController extends file
|
|||
// An error appears if file size exceeds a limit
|
||||
if($allowed_filesize < filesize($file_info['tmp_name'])) return new Object(-1, 'msg_exceeds_limit_size');
|
||||
// Get total file size of all attachements (from DB)
|
||||
$size_args = new stdClass;
|
||||
$size_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('file.getAttachedFileSize', $size_args);
|
||||
$attached_size = (int)$output->data->attached_size + filesize($file_info['tmp_name']);
|
||||
|
|
@ -664,10 +666,10 @@ class fileController extends file
|
|||
}
|
||||
// Create a directory
|
||||
if(!FileHandler::makeDir($path)) return new Object(-1,'msg_not_permitted_create');
|
||||
|
||||
|
||||
// Check uploaded file
|
||||
if(!checkUploadedFile($file_info['tmp_name'])) return new Object(-1,'msg_file_upload_error');
|
||||
|
||||
|
||||
// Move the file
|
||||
if($manual_insert)
|
||||
{
|
||||
|
|
@ -690,6 +692,7 @@ class fileController extends file
|
|||
$oMemberModel = &getModel('member');
|
||||
$member_srl = $oMemberModel->getLoggedMemberSrl();
|
||||
// List file information
|
||||
$args = new stdClass;
|
||||
$args->file_srl = getNextSequence();
|
||||
$args->upload_target_srl = $upload_target_srl;
|
||||
$args->module_srl = $module_srl;
|
||||
|
|
@ -879,7 +882,7 @@ class fileController extends file
|
|||
// Move the file
|
||||
FileHandler::rename($old_file, $new_file);
|
||||
// Update DB information
|
||||
unset($args);
|
||||
$args = new stdClass;
|
||||
$args->file_srl = $file_info->file_srl;
|
||||
$args->uploaded_filename = $new_file;
|
||||
$args->module_srl = $file_info->module_srl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue