diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 23c915335c5..4438812cc60 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -180,6 +180,8 @@ if ($action == 'addsite') // Add page if ($action == 'add') { + dol_mkdir($pathofwebsite); + $db->begin(); $objectpage->fk_website = $object->id; @@ -240,20 +242,25 @@ if ($action == 'add') } $objectpage->content = $tmp['content']; - $objectpage->content = preg_replace('/^.*
]*>/ims', '', $objectpage->content); - $objectpage->content = preg_replace('/<\/body[^>]*>.*$/ims', '', $objectpage->content); + $objectpage->content = preg_replace('/^.*]*)*>/ims', '', $objectpage->content); + $objectpage->content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $objectpage->content); + $absoluteurlinaction=$urltograbdirwithoutslash; + // TODO Replace 'action="$urltograbdirwithoutslash' into action="/" + // TODO Replace 'action="$urltograbdirwithoutslash..."' into action="..." + // TODO Replace 'a href="$urltograbdirwithoutslash' into a href="/" + // TODO Replace 'a href="$urltograbdirwithoutslash..."' into a href="..." // Now loop to fetch all css files. Include them inline into header of page $objectpage->htmlheader = $tmp['content']; - $objectpage->htmlheader = preg_replace('/^.*]*>/ims', '', $objectpage->htmlheader); - $objectpage->htmlheader = preg_replace('/<\/head[^>]*>.*$/ims', '', $objectpage->htmlheader); - $objectpage->htmlheader = preg_replace('/