Bug #90973 ยป patch-90973.diff
/home/franz/Arbeit/TYPO3/typo3_src-9.5.15/typo3/sysext/core/Classes/Routing/PageRouter.php 2020-04-07 16:09:41.047201519 +0200 | ||
---|---|---|
* @param array $parameters an array of query parameters which can be built into the URI path, also consider the special handling of "_language"
|
||
* @param string $fragment additional #my-fragment part
|
||
* @param string $type see the RouterInterface for possible types
|
||
* @param boolean $useCacheHash if cHash shall be added or not
|
||
* @return UriInterface
|
||
* @throws InvalidRouteArgumentsException
|
||
*/
|
||
public function generateUri($route, array $parameters = [], string $fragment = '', string $type = ''): UriInterface
|
||
public function generateUri($route, array $parameters = [], string $fragment = '', string $type = '', $useCacheHash = false): UriInterface
|
||
{
|
||
// Resolve language
|
||
$language = null;
|
||
... | ... | |
throw new InvalidRouteArgumentsException('Route arguments are dirty', 1537613247);
|
||
}
|
||
if ($matchedRoute && $pageRouteResult && !empty($pageRouteResult->getDynamicArguments())) {
|
||
if ($useCacheHash && $matchedRoute && $pageRouteResult && !empty($pageRouteResult->getDynamicArguments())) {
|
||
$cacheHash = $this->generateCacheHash($pageId, $pageRouteResult);
|
||
if (!empty($cacheHash)) {
|
/home/franz/Arbeit/TYPO3/typo3_src-9.5.15/typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php 2020-04-07 16:12:49.200234011 +0200 | ||
---|---|---|
// By default, it is assumed to ab an internal link or current domain's linking scheme should be used
|
||
// Use the config option to override this.
|
||
$useAbsoluteUrl = $conf['forceAbsoluteUrl'] ?? false;
|
||
// Use the cHash parameter
|
||
$useCacheHash = $conf['useCacheHash'] ?? false;
|
||
// Check if the current page equal to the site of the target page, now only set the absolute URL
|
||
// Always generate absolute URLs if no current site is set
|
||
if (
|
||
... | ... | |
$targetPageId,
|
||
$queryParameters,
|
||
$fragment,
|
||
$useAbsoluteUrl ? RouterInterface::ABSOLUTE_URL : RouterInterface::ABSOLUTE_PATH
|
||
$useAbsoluteUrl ? RouterInterface::ABSOLUTE_URL : RouterInterface::ABSOLUTE_PATH,
|
||
$useCacheHash
|
||
);
|
||
} catch (InvalidRouteArgumentsException $e) {
|
||
throw new UnableToLinkException('The target page could not be linked. Error: ' . $e->getMessage(), 1535472406);
|