GoBieN PR0

Joined: 10 Mar 2008 Posts: 53 Location: Belgium
|
Posted: Mon Mar 24, 2008 3:29 pm Post subject: Re: Rewrite problem when clicking from google. |
|
|
I found the mod btw:
http://www.phpbb.com/community/viewtopic.php?t=784615
For now i disabled the code change, but would like to know what to alter, either to the rules or to the mod code to get it to work.
| Code: | //$hilit_words = request_var('hilit', '', true);
$se_hilit = $referer = '';
if(isset($_SERVER['HTTP_REFERER']) || (getenv('HTTP_REFERER') !== false))
{
set_var($referer, (isset($_SERVER['HTTP_REFERER']) ? trim($_SERVER['HTTP_REFERER']) : trim(getenv('HTTP_REFERER'))), 'string');
$referer = @parse_url(htmlspecialchars_decode(utf8_normalize_nfc($referer)));
if(($referer !== false) && !empty($referer['query']))
{
$query_string = array();
parse_str($referer['query'], $query_string);
$engines = array(
'q' => 'google|live|msn|alltheweb|altavista|aol|ask|search|gigablast|najdi|netsprint|pchome|seznam|szukacz',
'p' => 'yahoo',
'query' => 'aol|cnn|lycos|mama|mamma|netscape',
'terms' => 'about',
't' => 'alice',
'encquery' => 'aol',
'wd' => 'baidu',
'qt' => 'looksmart',
'rdata' => 'voila',
'k' => 'yam',
'text' => 'yandex'
);
foreach($engines as $qs => $pattern)
{
if(!empty($query_string[$qs]) && preg_match("#^(.+\.)*($pattern)(\.[a-z]{2,4}){1,2}$#U", $referer['host']))
{
$se_hilit = trim(preg_replace('#\s{2,}#', ' ', str_replace(array('+', '-', '|', '(', ')'), ' ', $query_string[$qs])));
break;
}
}
}
}
$hilit_words = request_var('hilit', $se_hilit, true);
|
|
|
|