You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2009/04/07 14:53:58 UTC

svn commit: r762753 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java

Author: jdonnerstag
Date: Tue Apr  7 12:53:58 2009
New Revision: 762753

URL: http://svn.apache.org/viewvc?rev=762753&view=rev
Log:
fixed WICKET-2215 WebClientInfo does not set browerMajorVersion for IE8
Issue: WICKET-2215

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java?rev=762753&r1=762752&r2=762753&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebClientInfo.java Tue Apr  7 12:53:58 2009
@@ -16,6 +16,9 @@
  */
 package org.apache.wicket.protocol.http.request;
 
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.wicket.protocol.http.ClientProperties;
@@ -183,13 +186,10 @@
 		else if (browserInternetExplorer)
 		{
 			properties.setBrowserInternetExplorer(true);
-			if (userAgent.indexOf("msie 6.") != -1)
-			{
-				majorVersion = 6;
-			}
-			else if (userAgent.indexOf("msie 7.") != -1)
+			Matcher matcher = Pattern.compile("msie (\\d+)").matcher(userAgent);
+			if (matcher.find())
 			{
-				majorVersion = 7;
+				majorVersion = Integer.parseInt(matcher.group(1));
 			}
 		}