Joomla version: 1.5.20
Mobile Joomla! version: 0.9.7
Chrome version: 5.0.375.127
I've installed Mobile Joomla! on 2 Joomla sites and ran into the same issue. The Chrome brower is loading the XHTML smartphone version instead of the regular site.
It's being triggered in the simple.php plugin lines 60-61.
if(preg_match('|'.str_replace(array ('/', '.', '+'), array ('/', '.', '+'), $mime_type).';q=0(.[1-9]+)|i', $_SERVER['HTTP_ACCEPT'], $matches))
$c[$mime_lang] -= (float) $matches[1];
The Chrome $_SERVER['HTTP_ACCEPT'] is
application/xml,application/xhtml+xml,
text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Because the
text/html is showing up directly before the
;q=0.9 the it results in the $c array having this state:
Array (
[xhtml] => 2
[html] => 1.1
[wml] => 1
[mhtml] => 1
)
instead of
Array (
[xhtml] => 2
[html] => 2
[wml] => 1
[mhtml] => 1
)
Which results in the smartphone version being served.
As a temporary solution I added another conditional statement that looks at the useragent:
if(preg_match('|'.str_replace(array ('/', '.', '+'), array ('/', '.', '+'), $mime_type).';q=0(.[1-9]+)|i', $_SERVER['HTTP_ACCEPT'], $matches))
if (stripos($useragent,'chrome')===FALSE)
$c[$mime_lang] -= (float) $matches[1];
Have any advice/ideas on this issue?