瀏覽代碼

使用 ToLowerInvariant

Roc 5 年之前
父節點
當前提交
e7b895ed09

+ 1 - 1
src/Essensoft.AspNetCore.Payment.Alipay/AlipayDictionary.cs

@@ -52,7 +52,7 @@ namespace Essensoft.AspNetCore.Payment.Alipay
             }
             else if (value is bool?)
             {
-                strValue = (value as bool?).Value.ToString().ToLower();
+                strValue = (value as bool?).Value.ToString().ToLowerInvariant();
             }
             else
             {

+ 1 - 1
src/Essensoft.AspNetCore.Payment.Alipay/Utility/AlipayUtility.cs

@@ -116,7 +116,7 @@ namespace Essensoft.AspNetCore.Payment.Alipay.Utility
         public static string GetMimeType(string fileName)
         {
             string mimeType;
-            fileName = fileName.ToLower();
+            fileName = fileName.ToLowerInvariant();
 
             if (fileName.EndsWith(".bmp", StringComparison.CurrentCulture))
             {

+ 2 - 2
src/Essensoft.AspNetCore.Payment.Alipay/Utility/AntCertificationUtil.cs

@@ -70,14 +70,14 @@ namespace Essensoft.AspNetCore.Payment.Alipay.Utility
             //提取出的证书的issuerDN本身是以CN开头的,则无需逆序,直接返回
             if (issuerDN.StartsWith("CN", StringComparison.Ordinal))
             {
-                return MD5.Compute(issuerDN + cert.SerialNumber).ToLower();
+                return MD5.Compute(issuerDN + cert.SerialNumber).ToLowerInvariant();
             }
             else
             {
                 var attributes = issuerDN.Split(',').ToList();
                 attributes.Reverse();
 
-                return MD5.Compute(string.Join(",", attributes.ToArray()) + cert.SerialNumber).ToLower();
+                return MD5.Compute(string.Join(",", attributes.ToArray()) + cert.SerialNumber).ToLowerInvariant();
             }
         }