summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId/OpenId/Extensions
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-04-11 22:57:03 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2013-04-11 22:57:03 -0700
commit5f99dec3f56da3e2b2e276c48d8836b5678bcb18 (patch)
tree657486a665865d6bb474b7f0249d480094d3d3b9 /src/DotNetOpenAuth.OpenId/OpenId/Extensions
parentd15dc9733b914a37fcdd9c58bb42e46c887dc5fc (diff)
parent1694188f121307a5ff934685588be97d63e2dcf7 (diff)
downloadDotNetOpenAuth-5f99dec3f56da3e2b2e276c48d8836b5678bcb18.zip
DotNetOpenAuth-5f99dec3f56da3e2b2e276c48d8836b5678bcb18.tar.gz
DotNetOpenAuth-5f99dec3f56da3e2b2e276c48d8836b5678bcb18.tar.bz2
Merge branch 'v4.1' into v4.2
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/OpenId/Extensions')
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
index af60596..d121e62 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
@@ -192,7 +192,7 @@ namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration {
}
/// <summary>
- /// Gets or sets a combination o the language and country of the user.
+ /// Gets or sets a combination of the language and country of the user.
/// </summary>
[XmlIgnore]
public CultureInfo Culture {
@@ -203,7 +203,16 @@ namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration {
if (!string.IsNullOrEmpty(this.Country)) {
cultureString += "-" + this.Country;
}
- this.culture = CultureInfo.GetCultureInfo(cultureString);
+
+ // language-country may not always form a recongized valid culture.
+ // For instance, a Google OpenID Provider can return a random combination
+ // of language and country based on user settings.
+ try {
+ this.culture = CultureInfo.GetCultureInfo(cultureString);
+ } catch (CultureNotFoundException) {
+ // Fallback to just reporting a culture based on language.
+ this.culture = CultureInfo.GetCultureInfo(this.Language);
+ }
}
return this.culture;