Fix url or module provider

This commit is contained in:
Laurent Destailleur
2025-11-02 14:48:56 +01:00
parent 3d0703d5c6
commit 7ebb809547

View File

@@ -376,10 +376,12 @@ if ($mode == 'desc') {
}
$editor_url = $objMod->editor_url;
if (!preg_match('/^http/', $editor_url)) {
$editor_url = 'http://'.$editor_url;
$editor_url = 'https://'.$editor_url;
}
$editor_url_to_show = preg_replace('/(utm_[a-z_]+|origin)=[a-z0-9_]+/i', '', $editor_url);
$editor_url_to_show = preg_replace('/[\/\?]+$/', '', $editor_url_to_show);
if (!empty($objMod->editor_url) && !preg_match('/dolibarr\.org/i', $objMod->editor_url)) {
$textexternal .= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_picto('', 'globe').' <a href="'.$editor_url.'" target="_blank" rel="noopener noreferrer external">'.$objMod->editor_url.'</a>';
$textexternal .= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_picto('', 'globe').' <a href="'.$editor_url.'" target="_blank" rel="noopener noreferrer external">'.$editor_url_to_show.'</a>';
}
$text .= $textexternal;
} else {