Skip to content

Commit e453250

Browse files
authored
Merge pull request #470 from giokaxo/master
CKEditor useFile fix
2 parents 4bd9fb1 + dadd8be commit e453250

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/controllers/UploadController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ public function upload()
3939
return $this->errors;
4040
}
4141

42-
if (!$this->proceedSingleUpload($file)) {
42+
$filename = $this->proceedSingleUpload($file);
43+
if ($filename === false) {
4344
return $this->errors;
4445
}
4546

4647
// upload via ckeditor 'Upload' tab
47-
$new_filename = $this->getNewName($file);
48-
return $this->useFile($new_filename);
48+
return $this->useFile($filename);
4949
}
5050

5151

@@ -97,7 +97,7 @@ private function proceedSingleUpload($file)
9797
// TODO should be "FileWasUploaded"
9898
event(new ImageWasUploaded(realpath($new_file_path)));
9999

100-
return true;
100+
return $new_filename;
101101
}
102102

103103
private function fileIsValid($file)

0 commit comments

Comments
 (0)