0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Only import tables defined in core/server/data/schema.js

fixes #6287
This commit is contained in:
Fabian Becker 2016-01-11 10:31:24 +01:00
parent 97919abdde
commit 2770def8f1

View file

@ -78,7 +78,8 @@ checkDuplicateAttributes = function checkDuplicateAttributes(data, comparedValue
sanitize = function sanitize(data) {
var allProblems = {},
tableNames = _.sortBy(_.keys(data.data), function (tableName) {
tablesInData = _.keys(data.data),
tableNames = _.sortBy(_.keys(tables), function (tableName) {
// We want to guarantee posts and tags go first
if (tableName === 'posts') {
return 1;
@ -89,6 +90,8 @@ sanitize = function sanitize(data) {
return 3;
});
tableNames = _.intersection(tableNames, tablesInData);
_.each(tableNames, function (tableName) {
// Sanitize the table data for duplicates and valid uuid and created_at values
var sanitizedTableData = _.transform(data.data[tableName], function (memo, importValues) {