Skip to content

Commit

Permalink
Fix for images with special chars
Browse files Browse the repository at this point in the history
closes TryGhost#780
- added replacing of special chars with '_'
  • Loading branch information
sebgie committed Sep 17, 2013
1 parent 5662063 commit 60d93bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/server/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ adminControllers = {
tmp_path = req.files.uploadimage.path,
dir = path.join('content/images', year, month),
ext = path.extname(req.files.uploadimage.name).toLowerCase(),
basename = path.basename(req.files.uploadimage.name, ext);
basename = path.basename(req.files.uploadimage.name, ext).replace(/[\W]/gi, '_');

function renameFile(target_path) {
// adds directories recursively
Expand Down

0 comments on commit 60d93bd

Please sign in to comment.