diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php
index 698bb187d67..d9825ad6886 100644
--- a/htdocs/admin/dav.php
+++ b/htdocs/admin/dav.php
@@ -185,13 +185,13 @@ $message .= ajax_autoselect('webdavpublicurl');
$message .= '
';
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
- $urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : '');
- $url = ''.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'';
+ $urlEntity = (isModEnabled('multicompany') ? '?entity=' . $conf->entity : '');
+ $url = '' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '';
- $message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', ''));
- $message .= '