diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 3a6a580d43f..4696e2adc8f 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -23,7 +23,7 @@ /** - * Convert a page content to have correct links (based on DOL_URL_ROOT) into an html content. + * Convert a page content to have correct links (based on DOL_URL_ROOT) into an html content. It replaces also dynamic content with '...php...' * Used to ouput the page on the Preview from backoffice. * * @param Website $website Web site object @@ -61,7 +61,7 @@ function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $c $content = preg_replace('/href="<\?php((?!\?>).)*\?>\n*/ims', $replacewith, $content); //$replacewith='...php...'; - $replacewith='...php...'; + $replacewith='...phpx...'; if ($removephppart) $replacewith=''; //$content = preg_replace('/<\?php((?!\?toremove>).)*\?toremove>\n*/ims', $replacewith, $content); /*if ($content === null) { @@ -127,14 +127,15 @@ function dolStripPhpCode($str, $replacewith = '') $newstr .= $part; continue; } - //split on closing tag + // The second part is the php code. We split on closing tag $partlings = explode('?>', $part); if (!empty($partlings)) { + $phppart = $partlings[0]; //remove content before closing tag - if (count($partlings) > 1) $partlings[0] = ''; + if (count($partlings) > 1) $partlings[0] = ''; // Todo why a count > 1 and not >= 1 ? //append to out string - $newstr .= $replacewith.implode('', $partlings); + $newstr .= ''.$replacewith.''.implode('', $partlings); } } } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7ad03ef465a..58fe4008a28 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1441,6 +1441,9 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; print ''."\n"; print ''."\n"; + print ''."\n"; } // Browser notifications diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 12c23e721e2..6b73907ad70 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2199,7 +2199,53 @@ if (! GETPOST('hide_websitemenu')) print ''."\n"; print '