[BUGFIX] Wrong computed baseURL with FE editing RTE 42/52142/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Fri, 24 Mar 2017 14:01:08 +0000 (15:01 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 12 Jun 2017 12:47:58 +0000 (14:47 +0200)
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: 7.6
Change-Id: I57ae5257ab62cff1398a0b2d088fe7ba3b126c76
Reviewed-on: https://review.typo3.org/52142
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Elmar Hinz <t3elmar@gmail.com>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/feedit/Classes/FrontendEditPanel.php
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/Configuration/Config.js

index 73bc57f..51687de 100644 (file)
@@ -304,7 +304,7 @@ class FrontendEditPanel
      */
     protected function editPanelLinkWrap_doWrap($string, $url, $additionalClasses = '')
     {
-        $onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=' . ExtensionManagementUtility::extRelPath('backend') . 'Resources/Private/Templates/Close.html') . ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
+        $onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=' . rawurlencode(ExtensionManagementUtility::extRelPath('backend') . 'Resources/Private/Templates/Close.html')) . ',\'FEquickEditWindow\',\'width=690,height=500,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>';
     }
 
index 272aef4..1ce0594 100644 (file)
@@ -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