From 9e8d822b9045bdc788ac953400860939797669c1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 20 Nov 2008 21:29:54 +0000 Subject: [PATCH] Fix another problem with Sakai's href attribute handling --- chrome/content/zotero/xpcom/storage.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 3b50609d88..cf177a52fb 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -868,17 +868,19 @@ Zotero.Sync.Storage = new function () { href = href.path; } - if (href.indexOf(path) == -1) { + if (href.indexOf(path) == -1 + // Try URL-encoded as well, in case there's a '~' or similar + // character in the URL and the server (e.g., Sakai) is + // encoding the value + && decodeURIComponent(href).indexOf(path) == -1) { _error("DAV:href '" + href + "' does not begin with path '" + path + "' in " + funcName); } // Skip root URI - // - // Try URL-encoded as well, in case there's a '~' or similar - // character in the URL and the server (e.g., Sakai) is - // encoding the value - if (href == path || decodeURIComponent(href) == path) { + if (href == path + // Try URL-encoded as well, as above + || decodeURIComponent(href) == path) { continue; }