Bug Fixed: Windows 7 displaying as WinNTIn the project YAF.Classes.Utils in the code file YafContext.cs in the InitUserAndPage() function on line 878 the code needs to be changed from
else if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 7.0") >= 0)
to
else if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 6.1") >= 0)
with the surounding code, it would go from this
if ( HttpContext.Current.Request.UserAgent != null )
{
if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 5.2") >= 0)
platform = "Win2003";
else if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 6.0") >= 0)
platform = "Vista";
else if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 7.0") >= 0)
platform = "Win7";
else
// check if it's a search engine spider...
isSearchEngine = General.IsSearchEngineSpider(HttpContext.Current.Request.UserAgent);
}
to this:
if ( HttpContext.Current.Request.UserAgent != null )
{
if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 5.2") >= 0)
platform = "Win2003";
else if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 6.0") >= 0)
platform = "Vista";
else if (HttpContext.Current.Request.UserAgent.IndexOf("Windows NT 6.1") >= 0)
platform = "Win7";
else
// check if it's a search engine spider...
isSearchEngine = General.IsSearchEngineSpider(HttpContext.Current.Request.UserAgent);
}
----------------
Google Chrome reporting as AppleMAC-Safari 5.0
It turns out .NET itself reports it incorrectly so we must add an if statement.
Project: YAF.Classes.Utils
Context.cs (YAF.Classes.Utils.YafContext)
function InitUserAndPage()
below line 868 add
if (HttpContext.Current.Request.UserAgent.ToLower().Contains("chrome"))
browser = "Chrome 2.0";
with surrounding code:
string browser = String.Format( "{0} {1}", HttpContext.Current.Request.Browser.Browser, HttpContext.Current.Request.Browser.Version );
if (HttpContext.Current.Request.UserAgent.ToLower().Contains("chrome"))
browser = "Chrome 2.0";
bool isSearchEngine = false;
This should fix that annoying "AppleMAC-Safari 5.0" statement where Chrome should be.
ISSUE WITH FIX: If M$ fixes this, it will need to be changed.