diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3d98530ffd7..df7fcc0f005 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1231,8 +1231,8 @@ function dol_string_unaccent($str) * * @param string $str String to clean * @param string $newstr String to replace forbidden chars with - * @param array|string $badcharstoreplace List of forbidden characters to replace - * @param array|string $badcharstoremove List of forbidden characters to remove + * @param array|string $badcharstoreplace Array of forbidden characters to replace. Use '' to keep default list. + * @param array|string $badcharstoremove Array of forbidden characters to remove. Use '' to keep default list. * @return string Cleaned string * * @see dol_sanitizeFilename(), dol_string_unaccent(), dol_string_nounprintableascii() @@ -2881,15 +2881,15 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor // Use dictionary definition for picto $dictsocialnetworks[$type]['icon'] $htmllink .= ''; if ($type == 'skype') { - $htmllink .= $value; + $htmllink .= dol_escape_htmltag($value); $htmllink .= ' '; $htmllink .= ''; + $htmllink .= dol_string_nospecial($value, '_', '', array('@')); + $htmllink .= '?call" alt="'.$langs->trans("Call").' '.$value.'" title="'.dol_escape_htmltag($langs->trans("Call").' '.$value).'">'; $htmllink .= ''; $htmllink .= ''; + $htmllink .= dol_string_nospecial($value, '_', '', array('@')); + $htmllink .= '?chat" alt="'.$langs->trans("Chat").' '.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">'; $htmllink .= ''; $htmllink .= ''; if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { @@ -2903,9 +2903,9 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor } else { if (!empty($dictsocialnetworks[$type]['url'])) { $link = str_replace('{socialid}', $value, $dictsocialnetworks[$type]['url']); - $htmllink .= ' '.$value.''; + $htmllink .= ' '.dol_escape_htmltag($value).''; } else { - $htmllink .= $value; + $htmllink .= dol_escape_htmltag($value); } } $htmllink .= '';