From 17c210ca98481134b7d9ac3b45e35d26224c673d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Feb 2018 11:16:13 +0100 Subject: [PATCH] Normalize links href to Dolibarr internal naming --- htdocs/website/index.php | 5 +++++ 1 file changed, 5 insertions(+) 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;