From 320399dca94e8cb1a45e2330fed45b829e125b72 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 10 Dec 2024 03:00:57 -0500 Subject: [PATCH] Strip leading `://` or `//` in WebDAV URL Closes #3483 --- chrome/content/zotero/preferences/preferences_sync.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_sync.jsx b/chrome/content/zotero/preferences/preferences_sync.jsx index bd1b94e560..b85436b4f4 100644 --- a/chrome/content/zotero/preferences/preferences_sync.jsx +++ b/chrome/content/zotero/preferences/preferences_sync.jsx @@ -499,8 +499,8 @@ Zotero_Preferences.Sync = { var newProtocol = Zotero.Prefs.get('sync.storage.protocol'); var newURL = Zotero.Prefs.get('sync.storage.url').trim() - // Strip scheme and '/zotero' - .replace(/(^https?:\/\/|\/zotero\/?$|\/$)/g, '') + // Strip scheme, leading '://' or '//' (#3483), and trailing '/zotero' + .replace(/(^https?:\/\/|^:?\/\/|\/zotero\/?$|\/$)/g, '') Zotero.Prefs.set('sync.storage.url', newURL); if (oldProtocol != newProtocol || oldURL != newURL) {