[FOLLOWUP] Use GeneralUtility::quoteJSvalue() where needed part 1 49/39149/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Fri, 1 May 2015 10:52:29 +0000 (12:52 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 1 May 2015 12:04:48 +0000 (14:04 +0200)
Fix accidentally quoted global JavaScript variable in edit links.

Resolves: #66115
Releases: master
Change-Id: Iecc0ee98f2ad020153dc6ace168cdc9511fe2a77
Reviewed-on: http://review.typo3.org/39149
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 3d897e6..0344d77 100644 (file)
@@ -2734,11 +2734,12 @@ class BackendUtility {
         * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::issueCommand()
         */
        static public function editOnClick($params, $backPath = '', $requestUri = '') {
-               $returnUrl = $requestUri == -1
-                       ? '\'+T3_THIS_LOCATION+\''
-                       : rawurlencode($requestUri ?: GeneralUtility::getIndpEnv('REQUEST_URI'));
-               $retUrlParam = 'returnUrl=' . $returnUrl;
-               return 'window.location.href=' . GeneralUtility::quoteJSvalue(self::getModuleUrl('record_edit') . '&' . $retUrlParam . $params) . '; return false;';
+               if ($requestUri == -1) {
+                       $returnUrl = 'T3_THIS_LOCATION';
+               } else {
+                       $returnUrl = GeneralUtility::quoteJSvalue(rawurlencode($requestUri ?: GeneralUtility::getIndpEnv('REQUEST_URI')));
+               }
+               return 'window.location.href=' . GeneralUtility::quoteJSvalue(self::getModuleUrl('record_edit') . $params . '&returnUrl=') . '+' . $returnUrl . '; return false;';
        }
 
        /**