From 36c6bca4cde8a24cfbaa18d98fa5e577348fecfa Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Fri, 13 Feb 2009 00:57:36 +0000 Subject: [PATCH] don't index ru git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@358 c66351dc-e62f-0410-b875-e3a5c0b9693f --- site/libs/common.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/site/libs/common.php b/site/libs/common.php index c3bc936d..0bc5f671 100644 --- a/site/libs/common.php +++ b/site/libs/common.php @@ -82,6 +82,12 @@ function get_locale() { if( !$locale || !in_array($locale,$available_locales) ) $locale = get_user_locale(); + + $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : ""; + if( $locale == 'ru' && preg_match( "/googlebot[\\s\/]?(\\d+(\\.\\d+)?)/", $useragent) ) { + $locale = "en"; + } + return $locale; }