From 8ec09b00599d611cf1f78185901d0252738ca844 Mon Sep 17 00:00:00 2001 From: kkigomi Date: Fri, 30 Jun 2023 22:18:30 +0900 Subject: [PATCH] =?UTF-8?q?CHEditor=EC=97=90=EC=84=9C=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EC=97=85=EB=A1=9C=EB=93=9C=EC=8B=9C=20`get=5Fedito?= =?UTF-8?q?r=5Fupload=5Furl`=20Hook=EC=97=90=20=ED=8C=8C=EC=9D=BC=EC=9D=98?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `get_editor_upload_url` Hook의 세번째 인자에 파일의 추가 정보를 전달. smarteditor2에서 정의한 것과 동일한 유형으로 데이터를 담음. --- plugin/editor/cheditor5/imageUpload/upload.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugin/editor/cheditor5/imageUpload/upload.php b/plugin/editor/cheditor5/imageUpload/upload.php index 39e9dd928..463ae0d27 100644 --- a/plugin/editor/cheditor5/imageUpload/upload.php +++ b/plugin/editor/cheditor5/imageUpload/upload.php @@ -126,7 +126,22 @@ try { $file_url = SAVE_URL . '/' . $filename; if (function_exists('run_replace')) { - $file_url = run_replace('get_editor_upload_url', $file_url, $savefile, array()); + $fileInfo = new \stdClass(); + $fileInfo->name = (string) $filename; + $fileInfo->size = (int) $filesize; + $fileInfo->url = (string) $file_url; + + if (isset($_POST['origname'])) { + $fileInfo->oriname = (string) $_POST['origname']; + } + + if ($imgsize) { + $fileInfo->width = (int) $imgsize[0]; + $fileInfo->height = (int) $imgsize[1]; + $fileInfo->type = (string) $imgsize['mime']; + } + + $file_url = run_replace('get_editor_upload_url', $file_url, $savefile, $fileInfo); } $rdata = sprintf(