www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 20444eceb7be7a4b07729b8e2d71127774dab8d3
parent f0aae549c5b3615c3651d59ecbc9cadccf44630f
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date:   Fri, 14 Nov 2014 05:11:42 -0600

Sanitize primary fields in setField before comparing to current value

Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 15++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -718,8 +718,14 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { case 'itemTypeID': case 'dateAdded': case 'dateModified': + break; + case 'version': + value = parseInt(value); + break; + case 'synced': + value = !!value; break; default: @@ -744,15 +750,6 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) { this.setType(value, loadIn); } else { - switch (field) { - case 'version': - value = parseInt(value); - break; - - case 'synced': - value = !!value; - break; - } this['_' + field] = value;