Normalize links href to Dolibarr internal naming

This commit is contained in:
Laurent Destailleur 2018-02-20 11:16:13 +01:00
parent 32e8bab20d
commit 17c210ca98

View File

@ -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;