Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
ansuz 7 years ago
commit 18ed463a85

@ -134,12 +134,12 @@ define([
// check that old hashes parse correctly // check that old hashes parse correctly
assert(function (cb) { assert(function (cb) {
if (1) { return cb(true); } // TODO(cjd): This is a test failure which is a known bug //if (1) { return cb(true); } // TODO(cjd): This is a test failure which is a known bug
var secret = Hash.parsePadUrl('/pad/#67b8385b07352be53e40746d2be6ccd7XAYSuJYYqa9NfmInyHci7LNy'); var secret = Hash.parsePadUrl('/pad/#67b8385b07352be53e40746d2be6ccd7XAYSuJYYqa9NfmInyHci7LNy');
return cb(secret.hashData.channel === "67b8385b07352be53e40746d2be6ccd7" && return cb(secret.hashData.channel === "67b8385b07352be53e40746d2be6ccd7" &&
secret.hashData.key === "XAYSuJYYqa9NfmInyHci7LNy" && secret.hashData.key === "XAYSuJYYqa9NfmInyHci7LNy" &&
secret.hashData.version === 0 && secret.hashData.version === 0 &&
typeof(secret.hashData.getURL) === 'function'); typeof(secret.getUrl) === 'function');
}, "Old hash failed to parse"); }, "Old hash failed to parse");
// make sure version 1 hashes parse correctly // make sure version 1 hashes parse correctly

@ -525,11 +525,11 @@ define([
var h = p.hashData; var h = p.hashData;
var owners; var owners;
if (Store.channel && Util.base64ToHex(h.channel) === Store.channel.wc.id) { if (Store.channel && Store.channel.wc && Util.base64ToHex(h.channel) === Store.channel.wc.id) {
owners = Store.channel.data.owners || undefined; owners = Store.channel.data.owners || undefined;
} }
var expire; var expire;
if (Store.channel && Util.base64ToHex(h.channel) === Store.channel.wc.id) { if (Store.channel && Store.channel.wc && Util.base64ToHex(h.channel) === Store.channel.wc.id) {
expire = +Store.channel.data.expire || undefined; expire = +Store.channel.data.expire || undefined;
} }

Loading…
Cancel
Save