From 4e391be2dcd76defb5808d55d2a699a6925c853f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 25 Mar 2026 15:47:51 +0100 Subject: [PATCH] Fix edit dav: link --- htdocs/core/actions_linkedfiles.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 0dfe8e59123..397223a421b 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -117,7 +117,10 @@ if (GETPOST('sendit', 'alpha') && getDolGlobalString('MAIN_UPLOAD_DOC') && !empt } elseif (GETPOST('linkit', 'restricthtml') && getDolGlobalString('MAIN_UPLOAD_DOC') && !empty($permissiontoadd)) { $link = GETPOST('link', 'alpha'); if ($link) { - if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') { + if (substr($link, 0, 7) != 'http://' + && substr($link, 0, 8) != 'https://' + && substr($link, 0, 7) != 'davs://' + && (substr($link, 0, 7) != 'file://' || !getDolGlobalString('MAIN_ALLOW_LINK_STARTING_WITH_FILE'))) { $link = 'http://'.$link; } @@ -221,7 +224,10 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto $f = $link->fetch(GETPOSTINT('linkid')); if ($f) { $link->url = GETPOST('link', 'alpha'); - if (substr($link->url, 0, 7) != 'http://' && substr($link->url, 0, 8) != 'https://' && substr($link->url, 0, 7) != 'file://') { + if (substr($link->url, 0, 7) != 'http://' + && substr($link->url, 0, 8) != 'https://' + && substr($link->url, 0, 7) != 'davs://' + && (substr($link->url, 0, 7) != 'file://' || !getDolGlobalString('MAIN_ALLOW_LINK_STARTING_WITH_FILE'))) { $link->url = 'http://'.$link->url; } $link->label = GETPOST('label', 'alphanohtml');