Bug 1534337: Add _ separator in certificate export filename. r=keeler
authorTrushita <trushita@gmail.com>
Thu, 14 Mar 2019 16:43:50 +0000
changeset 521911 9071e6d7836b
parent 521910 e9f1a449031d
child 521912 2d742819b35b
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1534337
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1534337: Add _ separator in certificate export filename. r=keeler The certificate when exported had filename with no separator. Now added "_" separator to filename. Differential Revision: https://phabricator.services.mozilla.com/D23492
security/manager/pki/resources/content/pippki.js
--- a/security/manager/pki/resources/content/pippki.js
+++ b/security/manager/pki/resources/content/pippki.js
@@ -86,17 +86,17 @@ const DEFAULT_CERT_EXTENSION = "crt";
  * @returns {String}
  *          Generated filename.
  */
 function certToFilename(cert) {
   let filename = cert.displayName;
 
   // Remove unneeded and/or unsafe characters.
   filename = filename.replace(/\s/g, "")
-                     .replace(/\./g, "")
+                     .replace(/\./g, "_")
                      .replace(/\\/g, "")
                      .replace(/\//g, "");
 
   // Ci.nsIFilePicker.defaultExtension is more of a suggestion to some
   // implementations, so we include the extension in the file name as well. This
   // is what the documentation for Ci.nsIFilePicker.defaultString says we should do
   // anyways.
   return `${filename}.${DEFAULT_CERT_EXTENSION}`;