mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Protect against a malicious setDatabase. Remove unneeded save data.
This commit is contained in:
parent
7a17676b06
commit
9a1741f466
2 changed files with 5 additions and 4 deletions
|
@ -109,7 +109,7 @@ var Settings = (function SettingsClosure() {
|
|||
var database = null;
|
||||
var index;
|
||||
if (isFirefoxExtension)
|
||||
database = FirefoxCom.request('getDatabase', null);
|
||||
database = FirefoxCom.request('getDatabase', null) || '{}';
|
||||
else if (isLocalStorageEnabled)
|
||||
database = localStorage.getItem('database') || '{}';
|
||||
else
|
||||
|
@ -131,8 +131,6 @@ var Settings = (function SettingsClosure() {
|
|||
index = database.files.push({fingerprint: fingerprint}) - 1;
|
||||
this.file = database.files[index];
|
||||
this.database = database;
|
||||
if (isLocalStorageEnabled)
|
||||
localStorage.setItem('database', JSON.stringify(database));
|
||||
}
|
||||
|
||||
Settings.prototype = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue