mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
Merge pull request #2404 from webzwo0i/sanity-in-atext
block changeset if it deletes more lines than exist in the whole pad
This commit is contained in:
commit
7df944b3fd
2 changed files with 14 additions and 1 deletions
|
@ -742,7 +742,16 @@ function handleUserChanges(data, cb)
|
|||
return callback(new Error("Can't apply USER_CHANGES "+changeset+" with oldLen " + Changeset.oldLen(changeset) + " to document of length " + prevText.length));
|
||||
}
|
||||
|
||||
pad.appendRevision(changeset, thisSession.author);
|
||||
try
|
||||
{
|
||||
pad.appendRevision(changeset, thisSession.author);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
client.json.send({disconnect:"badChangeset"});
|
||||
stats.meter('failedChangesets').mark();
|
||||
return callback(e)
|
||||
}
|
||||
|
||||
var correctionChangeset = _correctMarkersInPad(pad.atext, pad.pool);
|
||||
if (correctionChangeset) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue