don't try to create a link when the link input field is empty
This commit is contained in:
parent
ce19b6da5c
commit
f19e5e86f4
@ -7,10 +7,12 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
|
|||||||
} elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
|
} elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||||
if ($object->id) {
|
if ($object->id) {
|
||||||
$link = GETPOST('link', 'alpha');
|
$link = GETPOST('link', 'alpha');
|
||||||
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://') {
|
if ($link) {
|
||||||
$link = 'http://' . $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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user