Project

General

Profile

Actions

Task #56721

closed

Epic #55070: Workpackages

Epic #55066: WP: Security enhancements

Story #55516: Reduce the number of backend script entry points

ElementBrowser::getThisScript is not public

Added by Philipp Wrann over 10 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2014-03-10
Due date:
% Done:

100%

Estimated time:
1.00 h
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
no-brainer
Sprint Focus:

Description

In \TYPO3\CMS\Recordlist\Browser\ElementBrowser the method getThisScript is not public but you need it in your hooks fot the LinkBrowser (to generate a valid url). You can use the public property but as the core implementation is like:

$menuDef['page']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue($this->getThisScript() . 'act=page') . ');return false;"';

It should be possible to use this method also from your hook

So please simple change accessibility for getThisScript to public.

Otherwise you have to do this in every single hook:
$script = strpos($this->parentObject->thisScript, '?') === FALSE ? $this->parentObject->thisScript . '?' : $this->parentObject->thisScript . '&';
$menuDefinition['KEY']['addParams'] = 'onclick="jumpToUrl(' . GeneralUtility::quoteJSvalue($script . 'act=KEY') . ');return false;"';

Additionally i have to say:
The common way before to generate the tab link was
$menuDefinition['KEY']['addParams'] = 'onclick="jumpToUrl(\'' . htmlspecialchars(('?act=KEY&mode=' . $this->parentObject->mode . '&bparams=' . $this->parentObject->bparams)) . '\');return false;"';

This is not compatible with TYPO3 6.2 anymore because of this new moduleToken, so it might be better to rethink that behaviour for the whole wizard. Otherwise many extension would be broken in that context.

Actions

Also available in: Atom PDF