Possible bug found in script regarding Browser Language detection
Posted: Fri Dec 12, 2008 8:27 pm
Hi.
Have installed cms-mle
And found this:
In function.mle.php you have this code (in function language_user_setting() ):
usort($browser_langs, "language_accept_order");
If I comment out that code it work as it should and honor my language settings in the browser:
I did a quick test doing this:
Code:
echo "Before: ";
print_r($browser_langs);
usort($browser_langs, "language_accept_order");
echo "After: ";
print_r($browser_langs);
And it looks to me that that usort makes it all fail:
Before usort it showed
no
en
in that order.
just as it is in my browser.
after it was
en
no
I do not see any reason to alter the order of the languages entered by the client in the browser and then use that
altered order to define which lang to use??
Looks like that is a bug?
If not a bug, then what is the reason for using usort here?
I originally posted my findings in this thread:
http://forum.cmsmadesimple.org/index.ph ... 700.0.html
But looks like it never was any real interest in it.
Anyway.... Now, finally and after one nights work my multilingual cmsmadesimple site finally detects and uses the
languages as set in client browser.
Before I commented out the usort line mentioned above, it DID not work as it should.
Regards
Have installed cms-mle
And found this:
In function.mle.php you have this code (in function language_user_setting() ):
usort($browser_langs, "language_accept_order");
If I comment out that code it work as it should and honor my language settings in the browser:
I did a quick test doing this:
Code:
echo "Before: ";
print_r($browser_langs);
usort($browser_langs, "language_accept_order");
echo "After: ";
print_r($browser_langs);
And it looks to me that that usort makes it all fail:
Before usort it showed
no
en
in that order.
just as it is in my browser.
after it was
en
no
I do not see any reason to alter the order of the languages entered by the client in the browser and then use that
altered order to define which lang to use??
Looks like that is a bug?
If not a bug, then what is the reason for using usort here?
I originally posted my findings in this thread:
http://forum.cmsmadesimple.org/index.ph ... 700.0.html
But looks like it never was any real interest in it.
Anyway.... Now, finally and after one nights work my multilingual cmsmadesimple site finally detects and uses the
languages as set in client browser.
Before I commented out the usort line mentioned above, it DID not work as it should.
Regards