Skip to content
Snippets Groups Projects
Commit a8c6b34b authored by Pierrick Caillon's avatar Pierrick Caillon Committed by Benni Mack
Browse files

[BUGFIX] Wrong computed baseURL with FE editing RTE

Frontend editing button for editing a content now
url encode the return URL. The HTMLAREA baseURL
computation now excludes query parameters and anchor
from the document URL.

Resolves: #79568
Related: #65705
Related: #65608
Releases: master
Change-Id: I57ae5257ab62cff1398a0b2d088fe7ba3b126c76
Reviewed-on: https://review.typo3.org/51489


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: default avatarMona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent 7d3fedff
Branches
Tags
No related merge requests found
......@@ -298,7 +298,7 @@ class FrontendEditPanel
{
$width = MathUtility::forceIntegerInRange($this->backendUser->getTSConfigVal('options.feedit.popupWidth'), 690, 5000, 690);
$height = MathUtility::forceIntegerInRange($this->backendUser->getTSConfigVal('options.feedit.popupHeight'), 500, 5000, 500);
$onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=' . PathUtility::getAbsoluteWebPath(ExtensionManagementUtility::siteRelPath('backend') . 'Resources/Private/Templates/Close.html')) . ',\'FEquickEditWindow\',\'width=' . $width . ',height=' . $height . ',status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
$onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=' . rawurlencode(PathUtility::getAbsoluteWebPath(ExtensionManagementUtility::siteRelPath('backend') . 'Resources/Private/Templates/Close.html'))) . ',\'FEquickEditWindow\',\'width=' . $width . ',height=' . $height . ',status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
return '<a href="#" class="btn btn-default btn-sm ' . htmlspecialchars($additionalClasses) . '" onclick="' . htmlspecialchars($onclick) . '" class="frontEndEditIconLinks">' . $string . '</a>';
}
......
......@@ -57,7 +57,7 @@ define(['TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/UserAgent',
this.baseURL = document.URL;
}
}
if (this.baseURL && this.baseURL.match(/(.*\:\/\/.*\/)[^\/]*/)) {
if (this.baseURL && this.baseURL.match(/(.*\:\/\/[^?#]*\/)[^\/]*/)) {
this.baseURL = RegExp.$1;
}
// URL-s
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment