FIX Missing some replacements in website module
This commit is contained in:
parent
49e61e237c
commit
df53826426
@ -93,6 +93,9 @@ function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $c
|
|||||||
$content=preg_replace('/(href=")(\/?document\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
$content=preg_replace('/(href=")(\/?document\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
||||||
$content=preg_replace('/(src=")(\/?document\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
$content=preg_replace('/(src=")(\/?document\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
||||||
|
|
||||||
|
// Fix relative link /viewimage.php with correct URL after the DOL_URL_ROOT: ...href="/viewimage.php?modulepart="
|
||||||
|
$content=preg_replace('/(url\(")(\/?viewimage\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
||||||
|
|
||||||
dol_syslog('dolWebsiteReplacementOfLinks end', LOG_DEBUG);
|
dol_syslog('dolWebsiteReplacementOfLinks end', LOG_DEBUG);
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
@ -185,7 +188,7 @@ function dolKeepOnlyPhpCode($str)
|
|||||||
* @param string $contenttype Content type
|
* @param string $contenttype Content type
|
||||||
* @param int $containerid Contenair id
|
* @param int $containerid Contenair id
|
||||||
* @return void
|
* @return void
|
||||||
* @see dolWebsiteReplacementOfLinks() for function used to replace content in the backoffice context when USEDOLIBARREDITOR is not on
|
* @see dolWebsiteReplacementOfLinks() for function used to replace content in the backoffice context.
|
||||||
*/
|
*/
|
||||||
function dolWebsiteOutput($content, $contenttype='html', $containerid='')
|
function dolWebsiteOutput($content, $contenttype='html', $containerid='')
|
||||||
{
|
{
|
||||||
@ -228,6 +231,7 @@ function dolWebsiteOutput($content, $contenttype='html', $containerid='')
|
|||||||
// Fix relative link /viewimage.php with correct URL after the DOL_URL_ROOT: href="/viewimage.php?modulepart=" => href="/dolibarr/viewimage.php?modulepart="
|
// Fix relative link /viewimage.php with correct URL after the DOL_URL_ROOT: href="/viewimage.php?modulepart=" => href="/dolibarr/viewimage.php?modulepart="
|
||||||
$content=preg_replace('/(href=")(\/?viewimage\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
$content=preg_replace('/(href=")(\/?viewimage\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
||||||
$content=preg_replace('/(src=")(\/?viewimage\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
$content=preg_replace('/(src=")(\/?viewimage\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
||||||
|
$content=preg_replace('/(url\(")(\/?viewimage\.php\?[^\"]*modulepart=[^\"]*)(\")/', '\1'.DOL_URL_ROOT.'\2\3', $content, -1, $nbrep);
|
||||||
|
|
||||||
// Fix relative link into medias with correct URL after the DOL_URL_ROOT: ../url("medias/
|
// Fix relative link into medias with correct URL after the DOL_URL_ROOT: ../url("medias/
|
||||||
$content=preg_replace('/url\((["\']?)medias\//', 'url(\1'.DOL_URL_ROOT.'/viewimage.php?modulepart=medias&file=', $content, -1, $nbrep);
|
$content=preg_replace('/url\((["\']?)medias\//', 'url(\1'.DOL_URL_ROOT.'/viewimage.php?modulepart=medias&file=', $content, -1, $nbrep);
|
||||||
|
|||||||
@ -3057,9 +3057,10 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm')
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="replacesiteconfirm">';
|
print '<input type="hidden" name="action" value="replacesiteconfirm">';
|
||||||
|
print '<input type="hidden" name="website" value="'.$website->ref.'">';
|
||||||
|
|
||||||
|
|
||||||
print '<!-- Edit Media -->'."\n";
|
print '<!-- Replace string -->'."\n";
|
||||||
print '<div class="fiche"><br>';
|
print '<div class="fiche"><br>';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ReplaceWebsiteContent"));
|
print load_fiche_titre($langs->trans("ReplaceWebsiteContent"));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user