Bug 1355977 - don't show GMT twice in certificate details. r=zibi
authorJorg K <mozilla@jorgk.com>
Tue, 16 Jan 2018 16:17:00 +0200
changeset 453945 9fd5dc9d82454b1597d8f02dd085df8c3a666b2d
parent 453944 7eaf34a4efa6768d94a9b7c4ceeabbde1e6910eb
child 453946 f8b2bbebb2f0ee6c8faa3c0023d2ceaa6796e02e
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszibi
bugs1355977
milestone59.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 1355977 - don't show GMT twice in certificate details. r=zibi
security/manager/ssl/nsNSSCertHelper.cpp
--- a/security/manager/ssl/nsNSSCertHelper.cpp
+++ b/security/manager/ssl/nsNSSCertHelper.cpp
@@ -1670,17 +1670,23 @@ ProcessTime(PRTime dispTime,
 
   PRExplodedTime explodedTimeGMT;
   PR_ExplodeTime(dispTime, PR_GMTParameters, &explodedTimeGMT);
 
   DateTimeFormat::FormatPRExplodedTime(
     kDateFormatLong, kTimeFormatSeconds, &explodedTimeGMT, tempString);
 
   text.Append(tempString);
-  text.AppendLiteral(" GMT)");
+  // Append "GMT" if it's not already added by the formatter
+  // since the OS pattern contained a timezone (Mac and Linux).
+  if (tempString.Find(" GMT") == kNotFound) {
+    text.AppendLiteral(" GMT)");
+  } else {
+    text.Append(')');
+  }
 
   nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
 
   printableItem->SetDisplayValue(text);
   printableItem->SetDisplayName(nsDependentString(displayName));
   nsCOMPtr<nsIMutableArray> asn1Objects;
   parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
   asn1Objects->AppendElement(printableItem);