Cleaned up regex a little.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
086d059e15
commit
9b3163412c
|
@ -65,19 +65,19 @@ function is_referer_search_engine($engine = 'google') {
|
|||
|
||||
switch ($engine) {
|
||||
case 'google':
|
||||
if (preg_match('/^http:\/\/w?w?w?\.?google.*/i', $referer)) {
|
||||
if (preg_match('|^http://(www)?\.?google.*|i', $referer)) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'lycos':
|
||||
if (preg_match('/^http:\/\/search\.lycos.*/i', $referer)) {
|
||||
if (preg_match('|^http://search\.lycos.*|i', $referer)) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'yahoo':
|
||||
if (preg_match('/^http:\/\/search\.yahoo.*/i', $referer)) {
|
||||
if (preg_match('|^http://search\.yahoo.*|i', $referer)) {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue