FIX Link to social network
This commit is contained in:
parent
d6ecbe65b7
commit
5ada47195a
@ -3012,8 +3012,16 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!empty($dictsocialnetworks[$type]['url'])) {
|
if (!empty($dictsocialnetworks[$type]['url'])) {
|
||||||
|
$tmpvirginurl = preg_replace('/\/?{socialid}/', '', $dictsocialnetworks[$type]['url']);
|
||||||
|
if ($tmpvirginurl) {
|
||||||
|
$value = preg_replace('/'.preg_quote($tmpvirginurl, '/').'\/?/', '', $value);
|
||||||
|
}
|
||||||
$link = str_replace('{socialid}', $value, $dictsocialnetworks[$type]['url']);
|
$link = str_replace('{socialid}', $value, $dictsocialnetworks[$type]['url']);
|
||||||
$htmllink .= ' <a href="'.dol_sanitizeUrl($link).'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
|
if (preg_match('/^https?:\/\//i', $link)) {
|
||||||
|
$htmllink .= ' <a href="'.dol_sanitizeUrl($link, 0).'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
|
||||||
|
} else {
|
||||||
|
$htmllink .= ' <a href="'.dol_sanitizeUrl($link, 1).'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$htmllink .= dol_escape_htmltag($value);
|
$htmllink .= dol_escape_htmltag($value);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user