From a8eecee590faf5f9f9fa8ccefe3791d842621ef1 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 25 Sep 2017 17:29:31 +0200 Subject: [PATCH] Fix access to undefined variable in drive --- www/common/userObject.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/www/common/userObject.js b/www/common/userObject.js index 3f4ab7dd6..ddacbb806 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -456,7 +456,7 @@ define([ }; exp.getRecentPads = function () { var allFiles = files[FILES_DATA]; - var sorted = Object.keys(allFiles) + var sorted = Object.keys(allFiles).filter(function (a) { return allFiles[a]; }) .sort(function (a,b) { return allFiles[a].atime < allFiles[b].atime; }) @@ -1037,20 +1037,6 @@ define([ } }); }; - var migrateAttributes = function (el, id, parsed) { - // Migrate old pad attributes - ['userid', 'previewMode'].forEach(function (attr) { - var key = parsed.hash + '.' + attr; - var key2 = parsed.hash.slice(0,-1) + '.' + attr;// old pads not ending with / - if (typeof(files[key]) !== "undefined" || typeof(files[key2]) !== "undefined") { - debug("Migrating pad attribute", attr, "for pad", id); - el[attr] = files[key] || files[key2]; - delete files[key]; - delete files[key2]; - } - }); - // Migration done - }; var fixFilesData = function () { if (typeof files[FILES_DATA] !== "object") { debug("OLD_FILES_DATA was not an object"); files[FILES_DATA] = {}; } var fd = files[FILES_DATA]; @@ -1077,8 +1063,6 @@ define([ continue; } - migrateAttributes(el, id, parsed); - if ((Cryptpad.isLoggedIn() || config.testMode) && rootFiles.indexOf(id) === -1) { debug("An element in filesData was not in ROOT, TEMPLATE or TRASH.", id, el); var newName = Cryptpad.createChannelId();