[Mono-bugs] [Bug 74777][Nor] New - HttpBrowserCapabilities does not detect IE properties correctly
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 30 Apr 2005 15:21:49 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by joe_audette@yahoo.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74777
--- shadow/74777 2005-04-30 15:21:49.000000000 -0400
+++ shadow/74777.tmp.22727 2005-04-30 15:21:49.000000000 -0400
@@ -0,0 +1,104 @@
+Bug#: 74777
+Product: Mono: Class Libraries
+Version: 1.1
+OS: SUSE 9.2
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: joe_audette@yahoo.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: HttpBrowserCapabilities does not detect IE properties correctly
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+There is a recent regression of a previous problem in
+System.Web.HttpBrowserCapabilities that I have seen before starting around
+mono 1.1.3 but fixed by 1.1.4 and now re-appearing.
+Not sure exactly what has changed but you can see in my code sample what
+properties are being checked to determine whether using a compatible browser.
+
+
+Steps to reproduce the problem:
+1. See the attached test page. On Windows IE and FireFox are both
+compatible browsers while on mono FireFox is compatible but IE is not
+
+
+Actual Results:
+IE is not found to be a compatible browser
+
+
+Expected Results:
+IE is found to be a compatible browser
+
+
+How often does this happen?
+Every time
+
+
+Additional Information:
+Test Case:
+
+<% @Import Namespace="System.Data" %>
+<% @Import Namespace="System.Globalization" %>
+
+<script language="c#" runat="server">
+
+
+
+ void Page_Load(Object o, EventArgs e)
+ {
+
+ lblBrowserIsCompatible.Text = CheckBrowserCompatibility().ToString();
+
+
+
+
+
+ }
+
+ public bool CheckBrowserCompatibility()
+ {
+ System.Web.HttpBrowserCapabilities oBrowser = Page.Request.Browser ;
+
+ // Internet Explorer 5.5+ for Windows
+ if (oBrowser.Browser == "IE" && ( oBrowser.MajorVersion >= 6 || (
+oBrowser.MajorVersion == 5 && oBrowser.MinorVersion >= 5 ) ) && oBrowser.Win32)
+ return true ;
+ else
+ {
+ Match oMatch = Regex.Match( this.Page.Request.UserAgent,
+@"(?<=Gecko/)\d{8}" ) ;
+ return ( oMatch.Success && int.Parse( oMatch.Value,
+CultureInfo.InvariantCulture ) >= 20030210 ) ;
+ }
+ }
+
+</script>
+
+
+<html>
+ <head><title>Test DateTime.Parse</title></head>
+
+ <body>
+ <form runat="server">
+
+ <h3>BrowserCompatibility = <asp:Label
+ID="lblBrowserIsCompatible" runat="server"></asp:Label></h3>
+
+
+
+
+
+ </form>
+ </body>
+
+</html>