Needs work
Project:
IP to Locale
Version:
6.x-1.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2012 at 06:02 UTC
Updated:
6 Feb 2012 at 06:02 UTC
If you will search your site in google search and pass throught search result link you won't be redirected to correct language.
This is because at line 147 you check HTTP_REFERER with strpos function, and it returrn 108, because google store redirect address in url param.
I change this line
isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'])
to
isset($_SERVER['HTTP_REFERER']) && preg_match('#http(?:s)?://'.$_SERVER['SERVER_NAME'].'#', $_SERVER['HTTP_REFERER'])
and now all looks work good.