Bug 1634052 - Make FOlderLookupService match the same schemes that the RDF service supported. r=benc
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 11 May 2020 19:20:22 +0300
changeset 39118 9129a21f6faca3ff846b238cd723cb1f5faa8cd7
parent 39117 2a5f7a05bc2c89f1a5dfd420af889cd4d64cd21e
child 39119 fc5a341a3e9f052b5343e1ac1dfeefa9e8fd7cd6
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersbenc
bugs1634052
Bug 1634052 - Make FOlderLookupService match the same schemes that the RDF service supported. r=benc
mailnews/base/src/FolderLookupService.jsm
--- a/mailnews/base/src/FolderLookupService.jsm
+++ b/mailnews/base/src/FolderLookupService.jsm
@@ -61,17 +61,17 @@ FolderLookupService.prototype = {
     if (folder) {
       return folder;
     }
 
     // Create new folder.
 
     // Check that uri has an active scheme, in case this folder is from
     // an extension that is currently disabled or hasn't started up yet.
-    let scheme = uri.match(/\w*/)[0];
+    let scheme = uri.match(/^([-+.\w]+):/)[1];
     let contractID = "@mozilla.org/mail/folder-factory;1?name=" + scheme;
     if (!(contractID in Cc)) {
       Cu.reportError(
         "getOrCreateFolderForURL: factory not registered for " + uri
       );
       return null;
     }