diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 84d2c19b9de..959529eb44e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -527,6 +527,11 @@ if ($action == 'addcontainer') getAllImages($object, $objectpage, $urltograb, $tmp, $action, 1, $grabimages, $grabimagesinto); + // Normalize links href to Dolibarr internal naming + $tmp = preg_replace('/a href="\/([^\/"]+)\/([^\/"]+)"/', 'a href="/\1-\2.php"', $tmp); + $tmp = preg_replace('/a href="\/([^\/"]+)\/([^\/"]+)\/([^\/"]+)"/', 'a href="/\1-\2-\3.php"', $tmp); + $tmp = preg_replace('/a href="\/([^\/"]+)\/([^\/"]+)\/([^\/"]+)\/([^\/"]+)"/', 'a href="/\1-\2-\3-\4.php"', $tmp); + //print dol_escape_htmltag($tmp);exit; $objectpage->content = $tmp;