0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Merge pull request #2486 from jaswilli/issue-2485

Replace spaces in uploaded filenames with hyphens
This commit is contained in:
Hannah Wolfe 2014-03-23 21:14:01 +00:00
commit eeb6297afe
2 changed files with 2 additions and 2 deletions

View file

@ -41,7 +41,7 @@ baseStore = {
'getUniqueFileName': function (store, image, targetDir) {
var done = when.defer(),
ext = path.extname(image.name),
name = path.basename(image.name, ext).replace(/[\W]/gi, '_');
name = path.basename(image.name, ext).replace(/[\W]/gi, '-');
this.generateUnique(store, targetDir, name, ext, 0, done);

View file

@ -44,7 +44,7 @@ describe('Local File System Storage', function () {
it('should send correct path to image when original file has spaces', function (done) {
image.name = 'AN IMAGE.jpg';
localfilesystem.save(image).then(function (url) {
url.should.equal('/content/images/2013/Sep/AN_IMAGE.jpg');
url.should.equal('/content/images/2013/Sep/AN-IMAGE.jpg');
return done();
}).then(null, done);
});