From dadd8be8fc502f16b78561033432cdbb1e631a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=83=92=E1=83=98=E1=83=9D=E1=83=A0=E1=83=92=E1=83=98=20?= =?UTF-8?q?=E1=83=99=E1=83=90=E1=83=AE=E1=83=9D=E1=83=A8=E1=83=95=E1=83=98?= =?UTF-8?q?=E1=83=9A=E1=83=98?= Date: Thu, 16 Nov 2017 14:51:44 +0400 Subject: [PATCH] CKEditor useFile fix CKEditor useFile function was returning different filename. --- src/controllers/UploadController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/UploadController.php b/src/controllers/UploadController.php index 203014e7..b96ee2bc 100644 --- a/src/controllers/UploadController.php +++ b/src/controllers/UploadController.php @@ -39,13 +39,13 @@ public function upload() return $this->errors; } - if (!$this->proceedSingleUpload($file)) { + $filename = $this->proceedSingleUpload($file); + if ($filename === false) { return $this->errors; } // upload via ckeditor 'Upload' tab - $new_filename = $this->getNewName($file); - return $this->useFile($new_filename); + return $this->useFile($filename); } @@ -97,7 +97,7 @@ private function proceedSingleUpload($file) // TODO should be "FileWasUploaded" event(new ImageWasUploaded(realpath($new_file_path))); - return true; + return $new_filename; } private function fileIsValid($file)