[BUGFIX] Using an apostrophe in the Workspace Name causes quite blank backend
authorMarco Bresch <marco.bresch@starfinanz.de>
Fri, 11 Nov 2011 14:12:57 +0000 (15:12 +0100)
committerMarco Bresch <marco.bresch@starfinanz.de>
Fri, 18 Nov 2011 14:09:09 +0000 (15:09 +0100)
This patch add backslashes to avoid JavaScript-errors when using apostrophes, quotes or backslashes in
the workspace title.

Change-Id: I66bf3864d10d713dda8e64cbde0846ef1a810868
Fixes: #28825
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/6632
Reviewed-by: Simon Schaufelberger
Tested-by: Simon Schaufelberger
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/workspaces/Classes/ExtDirect/WorkspaceSelectorToolbarItem.php

index a6fd52d..0ef7e3f 100644 (file)
@@ -62,7 +62,7 @@ class Tx_Workspaces_ExtDirect_WorkspaceSelectorToolbarItem implements backend_to
                $this->changeWorkspacePreview = t3lib_div::_GP('changeWorkspacePreview');
 
                $pageRenderer = t3lib_div::makeInstance('t3lib_pageRenderer');
-               $this->backendReference->addJavaScript("TYPO3.Workspaces = { workspaceTitle : '" . htmlspecialchars(Tx_Workspaces_Service_Workspaces::getWorkspaceTitle($GLOBALS['BE_USER']->workspace)) . "'};\n");
+               $this->backendReference->addJavaScript("TYPO3.Workspaces = { workspaceTitle : '" . htmlspecialchars(addslashes(Tx_Workspaces_Service_Workspaces::getWorkspaceTitle($GLOBALS['BE_USER']->workspace))) . "'};\n");
        }
 
        /**