Skip to content

Commit

Permalink
Only import tables defined in core/server/data/schema.js
Browse files Browse the repository at this point in the history
fixes #6287
  • Loading branch information
halfdan committed Jan 11, 2016
1 parent 97919ab commit 2770def
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/server/data/import/index.js
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit 2770def

Please sign in to comment.