mirror of
https://github.com/zotero/zotero.git
synced 2026-10-04 02:31:47 +00:00
Attempt to escape wrapper hell by serializing and unserializing the item
This commit is contained in:
parent
e45c48a66f
commit
71c63c6a74
1 changed files with 5 additions and 0 deletions
|
|
@ -100,6 +100,11 @@ Zotero_TranslatorTester._sanitizeItem = function(item, forSave) {
|
|||
}
|
||||
}
|
||||
|
||||
// try to convert to JSON and back to get rid of undesirable undeletable elements; this may fail
|
||||
try {
|
||||
item = JSON.parse(JSON.stringify(item));
|
||||
} catch(e) {};
|
||||
|
||||
// remove fields to be ignored
|
||||
for(var j=0, n=Zotero_TranslatorTester_IGNORE_FIELDS.length; j<n; j++) {
|
||||
delete item[Zotero_TranslatorTester_IGNORE_FIELDS[j]];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue