mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Validate all 'author' attribs of incoming changesets to be the same value as the current user's authorId
This commit is contained in:
parent
acb4b4ebaf
commit
c30b0b72b8
1 changed files with 6 additions and 1 deletions
|
@ -550,11 +550,16 @@ function handleUserChanges(client, message)
|
||||||
throw "Attribute pool is missing attribute "+n+" for changeset "+changeset;
|
throw "Attribute pool is missing attribute "+n+" for changeset "+changeset;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Validate all 'author' attribs to be the same value as the current user
|
||||||
|
wireApool.eachAttrib(function(type, value) {
|
||||||
|
if('author' == type && value != thisSession.author) throw "Trying to submit changes as another author"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
// There is an error in this changeset, so just refuse it
|
// There is an error in this changeset, so just refuse it
|
||||||
console.warn("Can't apply USER_CHANGES "+changeset+", because it failed checkRep");
|
console.warn("Can't apply USER_CHANGES "+changeset+", because: "+e);
|
||||||
client.json.send({disconnect:"badChangeset"});
|
client.json.send({disconnect:"badChangeset"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue