Bug #69021
closedPagetree context menu show preview button returns Invalid CSRF Token
100%
Description
If you klick at the Pagetree context menu to the button "show preview", a new window is opening and the error message: "The CSRF protection token for the requested module is missing or invalid" is returning.
The error is only if you are in a draft area in workspaces.
In live area there is no error message.
Updated by Marc Bauer over 9 years ago
I have found the error in typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeCommands.php
/** * Returns the view link of a given node * * @param stdClass $nodeData * @return string */ static public function getViewLink($nodeData) { /** @var $node \TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode */ $node = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\Pagetree\PagetreeNode::class, (array)$nodeData); $javascriptLink = stripslashes(BackendUtility::viewOnClick($node->getId())); preg_match('/window\\.open\\(\'([^\']+)\'/i', str_replace('u0026','&',$javascriptLink), $match); return $match[1]; }
The error is that the & in URL will be replaced by \u0026 but the pregmatch will be kill that and the url is only a long string :(
Updated by Oliver Hader about 9 years ago
- Status changed from New to Accepted
- Target version set to 7 LTS
Updated by Oliver Hader about 9 years ago
- Status changed from Accepted to In Progress
- Assignee set to Oliver Hader
Updated by Oliver Hader about 9 years ago
Basically the origin of this is in #66706 and the previous changed in that regard...
Encoding JavaScript data and then removing only slashes to circumvent double encodings is unfortunately not enough as it has been done in the mentioned change.
Updated by Gerrit Code Review about 9 years ago
- Status changed from In Progress to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44297
Updated by Oliver Hader about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8974fd23e7e6b4f1747c6e2a0adc11f24e4c2092.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed