Bug #63307 ยป quickfix-replaceModuleTokenInContentUrl.diff
AbstractContextMenuDataProvider.php 2015-03-08 14:17:50.257638390 +0100 | ||
---|---|---|
}
|
||
/**
|
||
* Add the CSRF token to the module URL if a "M" parameter is found
|
||
*
|
||
* @param string $contentUrl
|
||
* @return string
|
||
*/
|
||
protected function replaceModuleTokenInContentUrl($contentUrl) {
|
||
$safedMarker = str_replace('###ID###', '___ID___', $contentUrl);
|
||
$didSafe = $safedMarker!==$contentUrl;
|
||
if ($didSafe) {
|
||
$contentUrl = $safedMarker;
|
||
}
|
||
|
||
$parsedUrl = parse_url($contentUrl);
|
||
parse_str($parsedUrl['query'], $urlParameters);
|
||
if (isset($urlParameters['M'])) {
|
||
$moduleName = $urlParameters['M'];
|
||
unset($urlParameters['M']);
|
||
$contentUrl = BackendUtility::getModuleUrl($moduleName, $urlParameters);
|
||
}
|
||
if ($didSafe) {
|
||
$contentUrl = str_replace('___ID___', '###ID###', $contentUrl);
|
||
}
|
||
return $contentUrl;
|
||
}
|
||
}
|