PRS-12 코드 포맷
This commit is contained in:
@ -6,8 +6,8 @@ if(!function_exists('ft_nonce_is_valid')){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('che_reprocessImage')) {
|
if (!function_exists('che_reprocessImage')) {
|
||||||
function che_reprocessImage($file_path, $callback){
|
function che_reprocessImage($file_path, $callback)
|
||||||
|
{
|
||||||
$MIME_TYPES_PROCESSORS = array(
|
$MIME_TYPES_PROCESSORS = array(
|
||||||
"image/gif" => array("imagecreatefromgif", "imagegif"),
|
"image/gif" => array("imagecreatefromgif", "imagegif"),
|
||||||
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
|
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
|
||||||
@ -108,7 +108,7 @@ if (!$imgsize) {
|
|||||||
$filesize = 0;
|
$filesize = 0;
|
||||||
$random_name = '-ERR';
|
$random_name = '-ERR';
|
||||||
unlink($savefile);
|
unlink($savefile);
|
||||||
};
|
}
|
||||||
|
|
||||||
if (CHE_UPLOAD_IMG_CHECK && !che_reprocessImage($savefile, null)) {
|
if (CHE_UPLOAD_IMG_CHECK && !che_reprocessImage($savefile, null)) {
|
||||||
$filesize = 0;
|
$filesize = 0;
|
||||||
@ -117,7 +117,9 @@ if ( CHE_UPLOAD_IMG_CHECK && ! che_reprocessImage($savefile, null) ){
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(defined('G5_FILE_PERMISSION')) chmod($savefile, G5_FILE_PERMISSION);
|
if (defined('G5_FILE_PERMISSION')) {
|
||||||
|
chmod($savefile, G5_FILE_PERMISSION);
|
||||||
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,10 +129,12 @@ if( function_exists('run_replace') ){
|
|||||||
$file_url = run_replace('get_editor_upload_url', $file_url, $savefile, array());
|
$file_url = run_replace('get_editor_upload_url', $file_url, $savefile, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
$rdata = sprintf('{"fileUrl": "%s", "filePath": "%s", "fileName": "%s", "fileSize": "%d" }',
|
$rdata = sprintf(
|
||||||
|
'{"fileUrl": "%s", "filePath": "%s", "fileName": "%s", "fileSize": "%d" }',
|
||||||
$file_url,
|
$file_url,
|
||||||
$savefile,
|
$savefile,
|
||||||
$filename,
|
$filename,
|
||||||
$filesize );
|
$filesize
|
||||||
|
);
|
||||||
|
|
||||||
echo $rdata;
|
echo $rdata;
|
||||||
Reference in New Issue
Block a user