Fix detection of text browser with w3m

This commit is contained in:
Laurent Destailleur 2024-10-08 20:48:37 +02:00
parent f0a6e11e36
commit 21eb8e585f
2 changed files with 6 additions and 2 deletions

View File

@ -603,8 +603,12 @@ function getBrowserInfo($user_agent)
$version = end($reg);
} elseif (preg_match('/l[iy]n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) {
// MS products at end
$name = 'lynxlinks';
$name = 'textbrowser';
$version = empty($reg[3]) ? '' : $reg[3];
} elseif (preg_match('/w3m\/([\d\.]+)/i', $user_agent, $reg)) {
// MS products at end
$name = 'textbrowser';
$version = empty($reg[1]) ? '' : $reg[1];
}
if ($tablet) {

View File

@ -510,7 +510,7 @@ if (GETPOST('theme', 'aZ09')) {
}
// Set global MAIN_OPTIMIZEFORTEXTBROWSER (must be before login part)
if (GETPOSTINT('textbrowser') || (!empty($conf->browser->name) && $conf->browser->name == 'lynxlinks')) { // If we must enable text browser
if (GETPOSTINT('textbrowser') || (!empty($conf->browser->name) && $conf->browser->name == 'textbrowser')) { // If we must enable text browser
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 2;
}