{"action":"closed","issue":{"url":"https://api.github.com/repos/NullDesk/TicketDesk/issues/104","labels_url":"https://api.github.com/repos/NullDesk/TicketDesk/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/NullDesk/TicketDesk/issues/104/comments","events_url":"https://api.github.com/repos/NullDesk/TicketDesk/issues/104/events","html_url":"https://github.com/NullDesk/TicketDesk/issues/104","id":106098454,"number":104,"title":"Inifite loop if globalization culture not existing in web.confin","user":{"login":"zakbor0","id":14238532,"avatar_url":"https://avatars.githubusercontent.com/u/14238532?v=3","gravatar_id":"","url":"https://api.github.com/users/zakbor0","html_url":"https://github.com/zakbor0","followers_url":"https://api.github.com/users/zakbor0/followers","following_url":"https://api.github.com/users/zakbor0/following{/other_user}","gists_url":"https://api.github.com/users/zakbor0/gists{/gist_id}","starred_url":"https://api.github.com/users/zakbor0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zakbor0/subscriptions","organizations_url":"https://api.github.com/users/zakbor0/orgs","repos_url":"https://api.github.com/users/zakbor0/repos","events_url":"https://api.github.com/users/zakbor0/events{/privacy}","received_events_url":"https://api.github.com/users/zakbor0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NullDesk/TicketDesk/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"StephenRedd","id":321570,"avatar_url":"https://avatars.githubusercontent.com/u/321570?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenRedd","html_url":"https://github.com/StephenRedd","followers_url":"https://api.github.com/users/StephenRedd/followers","following_url":"https://api.github.com/users/StephenRedd/following{/other_user}","gists_url":"https://api.github.com/users/StephenRedd/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenRedd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenRedd/subscriptions","organizations_url":"https://api.github.com/users/StephenRedd/orgs","repos_url":"https://api.github.com/users/StephenRedd/repos","events_url":"https://api.github.com/users/StephenRedd/events{/privacy}","received_events_url":"https://api.github.com/users/StephenRedd/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/NullDesk/TicketDesk/milestones/3","html_url":"https://github.com/NullDesk/TicketDesk/milestones/TicketDesk%202.5%20RTM","labels_url":"https://api.github.com/repos/NullDesk/TicketDesk/milestones/3/labels","id":1111207,"number":3,"title":"TicketDesk 2.5 RTM","description":"Release ready version of TicketDesk 2.5","creator":{"login":"StephenRedd","id":321570,"avatar_url":"https://avatars.githubusercontent.com/u/321570?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenRedd","html_url":"https://github.com/StephenRedd","followers_url":"https://api.github.com/users/StephenRedd/followers","following_url":"https://api.github.com/users/StephenRedd/following{/other_user}","gists_url":"https://api.github.com/users/StephenRedd/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenRedd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenRedd/subscriptions","organizations_url":"https://api.github.com/users/StephenRedd/orgs","repos_url":"https://api.github.com/users/StephenRedd/repos","events_url":"https://api.github.com/users/StephenRedd/events{/privacy}","received_events_url":"https://api.github.com/users/StephenRedd/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":9,"state":"open","created_at":"2015-05-15T02:31:10Z","updated_at":"2016-01-08T04:36:33Z","due_on":"2015-12-31T05:00:00Z","closed_at":null},"comments":0,"created_at":"2015-09-11T21:33:51Z","updated_at":"2016-01-08T04:36:33Z","closed_at":"2016-01-08T04:36:33Z","body":"I branched the application and on running it for the first time I got StackOverflowException in private static string _defaultCulture. This is caused by infinite loop when <globalization culture=\"en-US\"/> entry does not exist in Web.config. Same error if the culture specified is not implemented or not-existant.\r\nI suggest securing the app from this exception by modyfying CultureHelper class.\r\n\r\nThe problem is that GetDefaultCulture() tries to get culture from web config (property _defaultCulture) by calling GetImplementedCulture. If error occurs there GetDefaultCulture() is called which creates a infinite loop...\r\n\r\nOne way to solve this could be that GetImplementedCulture in case of error should return hardcoded default culture \"en-US\" like this:\r\n        public static string GetImplementedCulture(string name)\r\n        {\r\n            // make sure it's not null\r\n            if (string.IsNullOrEmpty(name))\r\n                return GetDefaultCultureHardcoded(); // return Default culture\r\n            // make sure it is a valid culture first\r\n            if (_validCultures.Where(c => c.Equals(name, StringComparison.InvariantCultureIgnoreCase)).Count() == 0)\r\n                return GetDefaultCultureHardcoded(); // return Default culture if it is invalid\r\n            // if it is implemented, accept it\r\n            if (_cultures.Keys.Where(c => c.Equals(name, StringComparison.InvariantCultureIgnoreCase)).Count() > 0)\r\n                return name; // accept it\r\n            // Find a close match. For example, if you have \"en-US\" defined and the user requests \"en-GB\", \r\n            // the function will return closes match that is \"en-US\" because at least the language is the same (ie English)  \r\n            var n = GetNeutralCulture(name);\r\n            foreach (var c in _cultures.Keys)\r\n                if (c.StartsWith(n))\r\n                    return c;\r\n            // else \r\n            // It is not implemented\r\n            return GetDefaultCultureHardcoded(); // return Default culture as no match found\r\n        }\r\n\r\n        public static string GetDefaultCultureHardcoded()\r\n        {\r\n            return \"en-US\"; // return Default culture\r\n        }\r\n"}}