Skip to content
Snippets Groups Projects
Commit f19e5e86 authored by Cédric Salvador's avatar Cédric Salvador Committed by Raphaël Doursenaud
Browse files

don't try to create a link when the link input field is empty

parent ce19b6da
No related branches found
No related tags found
No related merge requests found
......@@ -7,10 +7,12 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
} elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
if ($object->id) {
$link = GETPOST('link', 'alpha');
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://') {
$link = 'http://' . $link;
if ($link) {
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://') {
$link = 'http://' . $link;
}
dol_add_file_process($upload_dir, 0, 1, 'userfile', $link);
}
dol_add_file_process($upload_dir, 0, 1, 'userfile', $link);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment