diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index 91ab7f792..4e7d16987 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -454,15 +454,12 @@ Pad.prototype.copy = function copy(destinationID, force, callback) { var _this = this; var destGroupID; - // make force optional - if (typeof force == "function") { - callback = force; - force = false; + // allow force to be a string + if (typeof force === "string") { + force = (force.toLowerCase() === "true"); + } else { + force = !!force; } - else if (force == undefined || force.toLowerCase() != "true") { - force = false; - } - else force = true; // Kick everyone from this pad. // This was commented due to https://github.com/ether/etherpad-lite/issues/3183.