Changeset 2133 for FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/tool/Compatibility.java
- Timestamp:
- 2008-06-25 09:17:42 (7 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/tool/Compatibility.java
r2101 r2133 35 35 /** 36 36 * Checks if a browser's user agent string is compatible for the FCKeditor. 37 * <br />38 * Adapted from:39 * http://dev.fckeditor.net/browser/FCKeditor/releases/stable/fckeditor.php40 37 * 41 * @param userAgentStr ing38 * @param userAgentStr 42 39 * @return <code>true</code> if compatible otherwise <code>false</code> 43 40 */ … … 45 42 if (Utils.isEmpty(userAgentString)) 46 43 return false; 47 48 float version;44 45 String userAgentStr = userAgentString.toLowerCase(); 49 46 50 47 // IE 5.5+, check special keys like 'Opera' and 'mac', because there are some 51 48 // other browsers, containing 'MSIE' in there agent string! 52 if (userAgentString.indexOf("Opera") < 0 && userAgentString.indexOf("mac") < 0) { 53 version = getBrowserVersion(userAgentString, ".*MSIE ([\\d]+.[\\d]+).*"); 54 if (version != -1f && version >= 5.5f) 49 if (userAgentStr.indexOf("opera") < 0 && userAgentStr.indexOf("mac") < 0) { 50 if (getBrowserVersion(userAgentStr, ".*msie ([\\d]+.[\\d]+).*") >= 5.5f) 55 51 return true; 56 52 } 57 58 // for mozilla only, because all firefox versions are supported 59 version = getBrowserVersion(userAgentString, ".*Gecko/([\\d]+).*"); 60 if (version != -1f && version >= 20030210f) 53 54 // for all gecko based browsers 55 if (getBrowserVersion(userAgentStr, ".*rv:([\\d]+.[\\d]+).*") > 1.7f) 61 56 return true; 62 57 63 58 // Opera 9.5+ 64 version = getBrowserVersion(userAgentString, "Opera/([\\d]+.[\\d]+).*"); 65 if (version != -1f && version >= 9.5f) 66 return true; 67 version = getBrowserVersion(userAgentString, ".*Opera ([\\d]+.[\\d]+)"); 68 if (version != -1f && version >= 9.5f) 59 if (getBrowserVersion(userAgentStr, "opera/([\\d]+.[\\d]+).*") >= 9.5f 60 || getBrowserVersion(userAgentStr, ".*opera ([\\d]+.[\\d]+)") >= 9.5f) 69 61 return true; 70 62 71 63 // Safari 3+ 72 version = getBrowserVersion(userAgentString, ".*AppleWebKit/([\\d]+).*"); 73 if (version != -1f && version >= 522f) 64 if (getBrowserVersion(userAgentStr, ".*applewebkit/([\\d]+).*") >= 522f) 74 65 return true; 75 66