www

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

commit c22b063d1d93ce89712a68b50f657bc40abc6bdf
parent e8e03f9e62620c1214a68239ebc2ce66019067aa
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  2 Feb 2010 13:00:21 +0000

Display helpful error when trying to sync files with invalid characters in their filenames


Diffstat:
Mchrome/content/zotero/xpcom/sync.js | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js @@ -3377,7 +3377,17 @@ Zotero.Sync.Server.Data = new function() { if (item.attachment.linkMode != Zotero.Attachments.LINK_MODE_LINKED_URL) { // Include paths for non-links - var path = <path>{item.attachment.path}</path>; + var path = item.attachment.path; + if (path != _xmlize(path)) { + var filename = item.attachment.path.substr(8); + // TODO: localize + var msg = "The filename '" + filename + "' contains invalid characters.\n\nRename the file and try again. " + + "If you rename the file via the OS, you will need to relink it in Zotero."; + var e = new Zotero.Error(msg, 0, { dialogButtonText: null }); + throw (e); + + } + path = <path>{path}</path>; xml.path += path; // Include storage sync time and hash for imported files