Merge pull request #5908 from openthink-laurent/add-file-scheme-allowed-uris-schemes-links
NEW Add file:// scheme to allowed URIs schemes for links
This commit is contained in:
commit
09ef693c5f
@ -40,7 +40,7 @@ elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
$link = GETPOST('link', 'alpha');
|
$link = GETPOST('link', 'alpha');
|
||||||
if ($link)
|
if ($link)
|
||||||
{
|
{
|
||||||
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://') {
|
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://') {
|
||||||
$link = 'http://' . $link;
|
$link = 'http://' . $link;
|
||||||
}
|
}
|
||||||
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link);
|
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link);
|
||||||
@ -124,7 +124,7 @@ elseif ($action == 'confirm_updateline' && GETPOST('save') && GETPOST('link', 'a
|
|||||||
if ($f)
|
if ($f)
|
||||||
{
|
{
|
||||||
$link->url = GETPOST('link', 'alpha');
|
$link->url = GETPOST('link', 'alpha');
|
||||||
if (substr($link->url, 0, 7) != 'http://' && substr($link->url, 0, 8) != 'https://')
|
if (substr($link->url, 0, 7) != 'http://' && substr($link->url, 0, 8) != 'https://' && substr($link->url, 0, 7) != 'file://')
|
||||||
{
|
{
|
||||||
$link->url = 'http://' . $link->url;
|
$link->url = 'http://' . $link->url;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user