<?php
-declare(strict_types=1);
+declare(strict_types = 1);
namespace TYPO3\CMS\Frontend\Typolink;
/*
*/
use TYPO3\CMS\Core\Service\DependencyOrderingService;
-use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
*/
protected function forceAbsoluteUrl(string $url, array $configuration): string
{
- if (!empty($url) && !empty($configuration['forceAbsoluteUrl']) && preg_match('#^(?:([a-z]+)(://)([^/]*)/?)?(.*)$#', $url, $matches)) {
+ if (!empty($url) && !empty($configuration['forceAbsoluteUrl']) && preg_match('#^(?:([a-z]+)(://)([^/]*)/?)?(.*)$#', $url, $matches)) {
$urlParts = [
'scheme' => $matches[1],
'delimiter' => '://',
*/
protected function processUrl(string $context, string $url, array $typolinkConfiguration = [])
{
- if (
- empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'])
- || !is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'])
- ) {
+ $urlProcessors = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'] ?? false;
+ if (!$urlProcessors) {
return $url;
}
- $urlProcessors = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors'];
foreach ($urlProcessors as $identifier => $configuration) {
if (empty($configuration) || !is_array($configuration)) {
throw new \RuntimeException('Missing configuration for URI processor "' . $identifier . '".', 1491130459);
// However, this is added to avoid any exceptions when trying to create a link
$GLOBALS['TSFE'] = GeneralUtility::makeInstance(
TypoScriptFrontendController::class,
- [],
- (int)GeneralUtility::_GP('id'),
+ null,
+ GeneralUtility::_GP('id'),
(int)GeneralUtility::_GP('type')
);
$GLOBALS['TSFE']->sys_page = GeneralUtility::makeInstance(PageRepository::class);
- $GLOBALS['TSFE']->sys_page->init(false);
- $GLOBALS['TSFE']->tmpl = GeneralUtility::makeInstance(TemplateService::class);
- $GLOBALS['TSFE']->tmpl->init();
+ $GLOBALS['TSFE']->initTemplate();
}
return $GLOBALS['TSFE'];
}