mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Fix readOnly pad export
The export request hook wasn't testing if the pad's id was from a read-only pad before validating with the pad manager. This includes an extra step that makes the read-only id verification and also avoids setting the original pad's id as the file's name.
This commit is contained in:
parent
9f63d9b76a
commit
c56973ce74
3 changed files with 27 additions and 7 deletions
|
@ -22,6 +22,16 @@
|
|||
var db = require("./DB");
|
||||
var randomString = require("../utils/randomstring");
|
||||
|
||||
|
||||
/**
|
||||
* checks if the id pattern matches a read-only pad id
|
||||
* @param {String} the pad's id
|
||||
*/
|
||||
exports.isReadOnlyId = function(id)
|
||||
{
|
||||
return id.indexOf("r.") === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a read only id for a pad
|
||||
* @param {String} padId the id of the pad
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue