Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kliger <alklig@microsoft.com>2018-10-09 22:33:41 +0300
committerMarek Safar <marek.safar@gmail.com>2018-10-10 01:47:26 +0300
commitfdfd781b4a8bcf5a278614b30733d462ef79d707 (patch)
tree19b22bbd54999733f265a92a4e2e2ab08555bdd4
parentd4c04793622cc33003d83e0d5022e35225fa05a2 (diff)
Always use InvariantCulture calendars in X509Certificate on Mobile
Allow the linker to remove UmAlQuraCalendar and HijriCalendar on mobile devices Match the CoreFX X509Certificate changes: https://github.com/mono/corefx/commit/4eb1fc2abd2ffa70e402d22415d0209b21725a10 Fixes https://github.com/mono/mono/issues/10448
-rw-r--r--mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
index 6a3398f0ce3..4f806a7dde4 100644
--- a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
+++ b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
@@ -608,10 +608,13 @@ namespace System.Security.Cryptography.X509Certificates
if (!culture.DateTimeFormat.Calendar.IsValidDay (date.Year, date.Month, date.Day, 0)) {
// The most common case of culture failing to work is in the Um-AlQuara calendar. In this case,
// we can fall back to the Hijri calendar, otherwise fall back to the invariant culture.
+#if !MOBILE
if (culture.DateTimeFormat.Calendar is UmAlQuraCalendar) {
culture = culture.Clone () as CultureInfo;
culture.DateTimeFormat.Calendar = new HijriCalendar ();
- } else {
+ } else
+#endif
+ {
culture = CultureInfo.InvariantCulture;
}
}