Updated secure-images option to not effect image name

Instead only the image path is altered.
Also fixed image manger mode not changing on button press.
This commit is contained in:
Dan Brown 2018-05-20 16:47:53 +01:00
parent 0c9c1e4c6b
commit 8c4c8cd95b
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 5 additions and 5 deletions

View File

@ -114,16 +114,16 @@ class ImageService extends UploadService
$secureUploads = setting('app-secure-images');
$imageName = str_replace(' ', '-', $imageName);
if ($secureUploads) {
$imageName = str_random(16) . '-' . $imageName;
}
$imagePath = '/uploads/images/' . $type . '/' . Date('Y-m-M') . '/';
while ($storage->exists($imagePath . $imageName)) {
$imageName = str_random(3) . $imageName;
}
$fullPath = $imagePath . $imageName;
if ($secureUploads) {
$fullPath = $imagePath . str_random(16) . '-' . $imageName;
}
try {
$storage->put($fullPath, $imageData);

View File

@ -547,7 +547,7 @@ class WysiwygEditor {
html += `<img src="${image.thumbs.display}" alt="${image.name}">`;
html += '</a>';
editor.execCommand('mceInsertContent', false, html);
});
}, 'gallery');
}
});