diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index 2a343808c8b..c357d0148d4 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -87,7 +87,7 @@ $var=!$var;
print '
| '.$langs->trans("CurrentTheme").' | '.$conf->theme.' |
'."\n";
$var=!$var;
print '| '.$langs->trans("CurrentMenuHandler").' | ';
-if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone)) print $conf->smart_menu;
+if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone)) print $conf->smart_menu;
else print $conf->top_menu;
print ' |
'."\n";
print '';
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index 10846f14e16..eb9156fd4b8 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -185,7 +185,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$conf->global->MAIN_APPLICATION_TITLE;
// Select templates
- if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone))
+ if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
{
$template_dir = DOL_DOCUMENT_ROOT.'/theme/phones/smartphone/tpl/';
}
diff --git a/htdocs/index.php b/htdocs/index.php
index e5d64da0357..1dc2a2b06f4 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -56,7 +56,7 @@ if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_IN
*/
// If smartphone mode, we do not show main page, we show only menu
-if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone))
+if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
{
$limitmenuto=GETPOST('limitmenuto')?GETPOST('limitmenuto'):0;
$limitmenuto=1; // A virer
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 5409712b6b0..1dc14515aba 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1503,7 +1503,7 @@ function main_area($title='')
print "\n";
print ' '."\n";
- if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone))
+ if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
{
print '
';
@@ -1628,7 +1628,7 @@ if (! function_exists("llxFooter"))
}
print "\n\n";
- if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone))
+ if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
{
print '
'."\n";
print '
'."\n";
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 86b263807bd..2becad4f564 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -150,7 +150,7 @@ $title='Dolibarr '.DOL_VERSION;
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$conf->global->MAIN_APPLICATION_TITLE;
// Select templates
-if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone))
+if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
{
$template_dir = DOL_DOCUMENT_ROOT.'/theme/phones/smartphone/tpl/';
}