mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
parent
17589a1afe
commit
1eff3d9471
1 changed files with 3 additions and 3 deletions
|
@ -17,8 +17,8 @@ var dataExport = require('../data/export'),
|
||||||
api.settings = require('./settings');
|
api.settings = require('./settings');
|
||||||
|
|
||||||
|
|
||||||
function isValidFile(type, ext) {
|
function isValidFile(ext) {
|
||||||
if (type === 'application/json' && ext === '.json') {
|
if (ext === '.json') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -75,7 +75,7 @@ db = {
|
||||||
ext = path.extname(options.importfile.name).toLowerCase();
|
ext = path.extname(options.importfile.name).toLowerCase();
|
||||||
filepath = options.importfile.path;
|
filepath = options.importfile.path;
|
||||||
|
|
||||||
return when(isValidFile(type, ext)).then(function (result) {
|
return when(isValidFile(ext)).then(function (result) {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return when.reject(new errors.UnsupportedMediaTypeError('Please select a .json file to import.'));
|
return when.reject(new errors.UnsupportedMediaTypeError('Please select a .json file to import.'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue