Skip to content

Commit

Permalink
Update functions2.lib.php
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Apr 18, 2019
1 parent 32b703e commit 4912c69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/lib/functions2.lib.php
Expand Up @@ -2496,15 +2496,15 @@ function autoOrManual($automaticmanual, $case = 1, $color = 0)

/**
* Convert links to local wrapper to medias files into a string into a public external URL readable on internet
*
*
* @param string $notetoshow Text to convert
* @return string String
*/
function convertBackOfficeMediasLinksToPublicLinks($notetoshow)
{
global $dolibarr_main_url_root;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$notetoshow=preg_replace('/src="[a-zA-Z0-9_\/\-\.]*(viewimage\.php\?modulepart=medias[^"]*)"/', 'src="'.$urlwithroot.'/\1"', $notetoshow);
Expand Down

0 comments on commit 4912c69

Please sign in to comment.