www

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

commit 6a20d690e05170ac11762cadb6299040eb2c37d2
parent 7a6656ae5c10614983e29a292cf456d34814328f
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat, 25 Oct 2008 02:47:47 +0000

Fix errors adding tags with leading or trailing spaces to items (since yesterday)


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

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -2689,6 +2689,8 @@ Zotero.Item.prototype.addTag = function(name, type) { throw ('Cannot add tag to unsaved item in Item.addTag()'); } + name = Zotero.Utilities.prototype.trim(name); + if (!name) { Zotero.debug('Not saving empty tag in Item.addTag()', 2); return false; @@ -2836,6 +2838,8 @@ Zotero.Item.prototype.replaceTag = function(oldTagID, newTag) { throw ('Cannot replace tag on unsaved item'); } + newTag = Zotero.Utilities.prototype.trim(newTag); + if (!newTag) { Zotero.debug('Not replacing with empty tag', 2); return false;