From 20444eceb7be7a4b07729b8e2d71127774dab8d3 Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Fri, 14 Nov 2014 05:11:42 -0600 Subject: [PATCH] Sanitize primary fields in setField before comparing to current value --- chrome/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 index b4430929df..306c5db6e2 100644 --- 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;