From 5bc91f0a7d006aeab881f5213a4717f526a04395 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Thu, 18 Dec 2008 15:09:44 +0000 Subject: [PATCH] detect google chrome git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@248 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/.settings/org.eclipse.core.resources.prefs | 3 ++- src/messenger/webim/libs/chat.php | 4 +++- src/messenger/webim/operator/update.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/messenger/.settings/org.eclipse.core.resources.prefs b/src/messenger/.settings/org.eclipse.core.resources.prefs index 19dfc5cd..f52ddc20 100644 --- a/src/messenger/.settings/org.eclipse.core.resources.prefs +++ b/src/messenger/.settings/org.eclipse.core.resources.prefs @@ -1,6 +1,7 @@ -#Thu Nov 27 12:24:15 CET 2008 +#Thu Dec 18 15:36:01 CET 2008 eclipse.preferences.version=1 encoding//webim/INSTALL_RUS.txt=cp1251 encoding//webim/locales/fr/properties=ISO-8859-1 +encoding//webim/locales/names/properties=utf-8 encoding//webim/locales/ru=cp1251 encoding//webim/locales/sp/properties=ISO-8859-1 diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php index 95b3129c..e02e9417 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -202,6 +202,8 @@ function is_ajax_browser($browserid,$ver,$useragent) { return $ver >= 1.4; if( $browserid == "firefox") return $ver >= 1.0; + if( $browserid == "chrome") + return true; return false; } @@ -214,7 +216,7 @@ function is_old_browser($browserid,$ver) { return false; } -$knownAgents = array("opera","msie","safari","firefox","netscape","mozilla"); +$knownAgents = array("opera","msie","chrome","safari","firefox","netscape","mozilla"); function get_remote_level($useragent) { global $knownAgents; diff --git a/src/messenger/webim/operator/update.php b/src/messenger/webim/operator/update.php index 081b71cc..7377c434 100644 --- a/src/messenger/webim/operator/update.php +++ b/src/messenger/webim/operator/update.php @@ -45,7 +45,7 @@ function get_useragent_version($userAgent) { $userAgent = strtolower($userAgent); foreach( $knownAgents as $agent ) { if( strstr($userAgent,$agent) ) { - if( preg_match( "/".$agent."[\\s\/]?(\\d+(\\.\\d+(\\.\\d+)?)?)/", $userAgent, $matches ) ) { + if( preg_match( "/".$agent."[\\s\/]?(\\d+(\\.\\d+(\\.\\d+(\\.\\d+)?)?)?)/", $userAgent, $matches ) ) { $ver = $matches[1]; if($agent=='safari') { if(preg_match( "/version\/(\\d+(\\.\\d+(\\.\\d+)?)?)/", $userAgent, $matches)) {