‪TYPO3CMS  9.5
TypoScriptFrontendController.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Doctrine\DBAL\DBALException;
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
20 use Psr\Log\LoggerAwareInterface;
21 use Psr\Log\LoggerAwareTrait;
80 
96 class ‪TypoScriptFrontendController implements LoggerAwareInterface
97 {
98  use LoggerAwareTrait;
100 
102  'tempPageCacheContent' => 'Using $TSFE->tempPageCacheContent() has been marked as internal as its purpose is to be managed from within TSFE directly.',
103  'realPageCacheContent' => 'Using $TSFE->realPageCacheContent() has been marked as internal as its purpose is to be managed from within TSFE directly.',
104  'setPageCacheContent' => 'Using $TSFE->setPageCacheContent() has been marked as internal as its purpose is to be managed from within TSFE directly.',
105  'clearPageCacheContent_pidList' => 'Using $TSFE->clearPageCacheContent_pidList() has been marked as internal as its purpose is to be managed from within TSFE directly.',
106  'setSysLastChanged' => 'Using $TSFE->setSysLastChanged() has been marked as internal as its purpose is to be managed from within TSFE directly.',
107  'contentStrReplace' => 'Using $TSFE->contentStrReplace() has been marked as internal as its purpose is to be managed from within TSFE directly.',
108  'mergingWithGetVars' => '$TSFE->mergingWithGetVars() will be removed in TYPO3 v10.0. Use a middleware instead to override the PSR-7 request object AND set $_GET on top to achieve the same result.',
109  ];
110 
115  public ‪$id = '';
116 
121  public ‪$type = '';
122 
128  public ‪$cHash = '';
129 
134  protected ‪$pageArguments;
135 
141  public ‪$no_cache = false;
142 
147  public ‪$rootLine = [];
148 
153  public ‪$page = [];
154 
160  public ‪$contentPid = 0;
161 
170 
179  protected ‪$originalShortcutPage;
180 
186  public ‪$sys_page = '';
187 
197  protected ‪$activeUrlHandlers = [];
198 
204  public ‪$pageNotFound = 0;
205 
211  public ‪$domainStartPage = 0;
212 
218  protected ‪$pageAccessFailureHistory = [];
219 
224  public ‪$MP = '';
225 
233  public ‪$page_cache_reg1 = 0;
234 
242  public ‪$siteScript = '';
243 
249  public ‪$fe_user = '';
250 
258  protected ‪$loginUser = false;
259 
267  protected ‪$gr_list = '';
268 
274  protected ‪$beUserLogin = false;
275 
282  protected ‪$workspacePreview = 0;
283 
288  protected ‪$loginAllowedInBranch = true;
289 
295  protected ‪$loginAllowedInBranch_mode = '';
296 
302  protected ‪$ADMCMD_preview_BEUSER_uid = 0;
303 
311  public ‪$fePreview = 0;
312 
319  protected ‪$showHiddenPage = false;
320 
328  protected ‪$showHiddenRecords = false;
329 
335  public ‪$simUserGroup = 0;
336 
342  public ‪$config = [];
343 
349  public ‪$tmpl;
350 
357  protected ‪$cacheTimeOutDefault = false;
358 
365  protected ‪$cacheContentFlag = false;
366 
372  protected ‪$cacheExpires = 0;
373 
379  protected ‪$isClientCachable = false;
380 
387  public ‪$all = [];
388 
393  public ‪$sPre = '';
394 
400  public ‪$pSetup = '';
401 
408  public ‪$newHash = '';
409 
418  public ‪$getMethodUrlIdToken = '';
419 
428  protected ‪$no_cacheBeforePageGen = false;
429 
438  protected ‪$tempContent = false;
439 
444  public ‪$forceTemplateParsing = false;
445 
451  public ‪$cHash_array = [];
452 
458  protected ‪$pagesTSconfig = '';
459 
474 
479  public ‪$additionalFooterData = [];
480 
487  public ‪$additionalJavaScript = [];
488 
494  public ‪$additionalCSS = [];
495 
499  public ‪$JSCode;
500 
504  public ‪$inlineJS;
505 
510  public ‪$divSection = '';
511 
517  protected ‪$debug = false;
518 
523  public ‪$intTarget = '';
524 
529  public ‪$extTarget = '';
530 
535  public ‪$fileTarget = '';
536 
543  protected ‪$MP_defaults = [];
544 
550 
555  public ‪$absRefPrefix = '';
556 
561  public ‪$ATagParams = '';
562 
570  public ‪$sWordRegEx = '';
571 
578  public ‪$sWordList = '';
579 
586  public ‪$linkVars = '';
587 
593  public ‪$displayEditIcons = '';
594 
601  public ‪$displayFieldEditIcons = '';
602 
611  protected ‪$sys_language_uid = 0;
612 
618  protected ‪$sys_language_mode = '';
619 
626  protected ‪$sys_language_content = 0;
627 
638  protected ‪$sys_language_contentOL = 0;
639 
645  public ‪$sys_language_isocode = '';
646 
652  public ‪$applicationData = [];
653 
657  public ‪$register = [];
658 
664  public ‪$registerStack = [];
665 
671  public ‪$cObjectDepthCounter = 50;
672 
678  public ‪$recordRegister = [];
679 
687  public ‪$currentRecord = '';
688 
694  public ‪$accessKey = [];
695 
701  public ‪$imagesOnPage = [];
702 
708  public ‪$lastImageInfo = [];
709 
716  protected ‪$uniqueCounter = 0;
717 
722  protected ‪$uniqueString = '';
723 
729  public ‪$indexedDocTitle = '';
730 
737  public ‪$altPageTitle = '';
738 
743  public ‪$baseUrl = '';
744 
750  private ‪$usedUniqueIds = [];
751 
757  public ‪$cObj = '';
758 
763  public ‪$content = '';
764 
771  public ‪$metaCharset = 'utf-8';
772 
778  protected ‪$lang = '';
779 
785  protected ‪$languageService;
786 
790  protected ‪$locks = [];
791 
795  protected ‪$pageRenderer;
796 
803  protected ‪$pageCache;
804 
808  protected ‪$pageCacheTags = [];
809 
815  protected ‪$cacheHash;
816 
824  protected ‪$contentType = 'text/html';
825 
831  public ‪$xhtmlDoctype = '';
832 
836  public ‪$xhtmlVersion;
837 
843  protected ‪$requestedId;
844 
851  protected ‪$context;
852 
867  public function ‪__construct($_ = null, ‪$id, ‪$type, ‪$no_cache = null, ‪$cHash = '', $_2 = null, ‪$MP = '')
868  {
869  // Setting some variables:
870  $this->id = ‪$id;
871  $this->type = ‪$type;
872  if (‪$no_cache !== null) {
873  trigger_error('Calling TypoScriptFrontendController->__construct() with $no_cache argument set will be removed in TYPO3 v10.0. Use ->set_no_cache() instead.', E_USER_DEPRECATED);
874  if (‪$no_cache) {
875  if (‪$GLOBALS['TYPO3_CONF_VARS']['FE']['disableNoCacheParameter']) {
876  $warning = '&no_cache=1 has been ignored because $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set!';
877  $this->‪getTimeTracker()->‪setTSlogMessage($warning, 2);
878  } else {
879  $warning = '&no_cache=1 has been supplied, so caching is disabled! URL: "' . GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') . '"';
880  $this->‪disableCache();
881  }
882  // note: we need to instantiate the logger manually here since the injection happens after the constructor
883  GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__)->warning($warning);
884  }
885  }
886  $this->cHash = (string)‪$cHash;
887  $this->MP = ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids'] ? (string)‪$MP : '';
888  $this->uniqueString = md5(microtime());
889  $this->‪initPageRenderer();
890  // Call post processing function for constructor:
891  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'])) {
892  trigger_error('The "tslib_fe-PostProc" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
893  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'] as $_funcRef) {
894  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
895  }
896  }
897  $this->cacheHash = GeneralUtility::makeInstance(CacheHashCalculator::class);
898  $this->‪initCaches();
899  // Use the global context for now
900  $this->context = GeneralUtility::makeInstance(Context::class);
901  }
902 
906  protected function ‪initPageRenderer()
907  {
908  if ($this->pageRenderer !== null) {
909  return;
910  }
911  $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
912  $this->pageRenderer->setTemplateFile('EXT:frontend/Resources/Private/Templates/MainPage.html');
913  }
914 
919  public function ‪setContentType(‪$contentType)
920  {
921  $this->contentType = ‪$contentType;
922  }
923 
932  public function ‪connectToDB()
933  {
934  trigger_error('The method "' . __METHOD__ . '" will be removed in TYPO3 v10.0, as the database connection is checked in the TypoScriptFrontendInitialization middleware.', E_USER_DEPRECATED);
935  try {
936  $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages');
937  $connection->connect();
938  } catch (DBALException $exception) {
939  // Cannot connect to current database
940  $message = sprintf(
941  'Cannot connect to the configured database. Connection failed with: "%s"',
942  $exception->getMessage()
943  );
944  $this->logger->emergency($message, ['exception' => $exception]);
945  try {
946  $response = GeneralUtility::makeInstance(ErrorController::class)->unavailableAction(
947  ‪$GLOBALS['TYPO3_REQUEST'],
948  $message,
950  );
951  throw new ImmediateResponseException($response, 1533931298);
952  } catch (ServiceUnavailableException $e) {
953  throw new ServiceUnavailableException($message, 1301648782);
954  }
955  }
956  // Call post processing function for DB connection
957  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'])) {
958  trigger_error('The "connectToDB" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
959  $_params = ['pObj' => &$this];
960  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['connectToDB'] as $_funcRef) {
961  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
962  }
963  }
964  }
965 
966  /********************************************
967  *
968  * Initializing, resolving page id
969  *
970  ********************************************/
974  protected function ‪initCaches()
975  {
976  $this->pageCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_pages');
977  }
978 
983  public function ‪initFEuser()
984  {
985  trigger_error('$TSFE->initFEuser() will be removed in TYPO3 v10.0. Use the FrontendUserAuthenticator middleware instead to initialize a Frontend User object.', E_USER_DEPRECATED);
986  $this->fe_user = GeneralUtility::makeInstance(FrontendUserAuthentication::class);
987  // List of pid's acceptable
988  $pid = GeneralUtility::_GP('pid');
989  $this->fe_user->checkPid_value = $pid ? implode(',', GeneralUtility::intExplode(',', $pid)) : 0;
990  // Check if a session is transferred:
991  if (GeneralUtility::_GP('FE_SESSION_KEY')) {
992  $fe_sParts = explode('-', GeneralUtility::_GP('FE_SESSION_KEY'));
993  // If the session key hash check is OK:
994  if (md5($fe_sParts[0] . '/' . ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']) === (string)$fe_sParts[1]) {
996  $_COOKIE[$cookieName] = $fe_sParts[0];
997  if (isset($_SERVER['HTTP_COOKIE'])) {
998  // See http://forge.typo3.org/issues/27740
999  $_SERVER['HTTP_COOKIE'] .= ';' . $cookieName . '=' . $fe_sParts[0];
1000  }
1001  $this->fe_user->forceSetCookie = true;
1002  $this->fe_user->dontSetCookie = false;
1003  unset($cookieName);
1004  }
1005  }
1006  $this->fe_user->start();
1007  $this->fe_user->unpack_uc();
1008 
1009  // Call hook for possible manipulation of frontend user object
1010  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'])) {
1011  trigger_error('The "initFEuser" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
1012  $_params = ['pObj' => &$this];
1013  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'] as $_funcRef) {
1014  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1015  }
1016  }
1017  }
1023  public function ‪initUserGroups()
1024  {
1025  $userGroups = [0];
1026  // This affects the hidden-flag selecting the fe_groups for the user!
1027  $this->fe_user->showHiddenRecords = $this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false);
1028  // no matter if we have an active user we try to fetch matching groups which can be set without an user (simulation for instance!)
1029  $this->fe_user->fetchGroupData();
1030  $isUserAndGroupSet = is_array($this->fe_user->user) && !empty($this->fe_user->groupData['uid']);
1031  if ($isUserAndGroupSet) {
1032  // group -2 is not an existing group, but denotes a 'default' group when a user IS logged in.
1033  // This is used to let elements be shown for all logged in users!
1034  $userGroups[] = -2;
1035  $groupsFromUserRecord = $this->fe_user->groupData['uid'];
1036  } else {
1037  // group -1 is not an existing group, but denotes a 'default' group when not logged in.
1038  // This is used to let elements be hidden, when a user is logged in!
1039  $userGroups[] = -1;
1040  if ($this->loginAllowedInBranch) {
1041  // For cases where logins are not banned from a branch usergroups can be set based on IP masks so we should add the usergroups uids.
1042  $groupsFromUserRecord = $this->fe_user->groupData['uid'];
1043  } else {
1044  // Set to blank since we will NOT risk any groups being set when no logins are allowed!
1045  $groupsFromUserRecord = [];
1046  }
1047  }
1048  // Clean up.
1049  // Make unique and sort the groups
1050  $groupsFromUserRecord = array_unique($groupsFromUserRecord);
1051  if (!empty($groupsFromUserRecord) && !$this->loginAllowedInBranch_mode) {
1052  sort($groupsFromUserRecord);
1053  $userGroups = array_merge($userGroups, array_map('intval', $groupsFromUserRecord));
1054  }
1055 
1056  $this->context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, $this->fe_user ?: null, $userGroups));
1057 
1058  // For every 60 seconds the is_online timestamp for a logged-in user is updated
1059  if ($isUserAndGroupSet) {
1060  $this->fe_user->updateOnlineTimestamp();
1061  }
1062 
1063  $this->logger->debug('Valid usergroups for TSFE: ' . implode(',', $userGroups));
1064  }
1065 
1071  public function ‪isUserOrGroupSet()
1072  {
1074  $userAspect = $this->context->getAspect('frontend.user');
1075  return $userAspect->isUserOrGroupSet();
1076  }
1077 
1088  {
1089  trigger_error('$TSFE->checkAlternativeIdMethods() will removed in TYPO3 v10.0, extensions should use a Frontend PSR-15-based middleware to hook into the frontend process. There is no need to call this method directly.', E_USER_DEPRECATED);
1090  $this->siteScript = GeneralUtility::getIndpEnv('TYPO3_SITE_SCRIPT');
1091  // Call post processing function for custom URL methods.
1092  $_params = ['pObj' => &$this];
1093  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkAlternativeIdMethods-PostProc'] ?? [] as $_funcRef) {
1094  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1095  }
1096  }
1097 
1103  public function ‪clear_preview()
1104  {
1105  if ($this->‪isInPreviewMode()) {
1106  $GLOBALS['SIM_EXEC_TIME'] = ‪$GLOBALS['EXEC_TIME'];
1107  ‪$GLOBALS['SIM_ACCESS_TIME'] = ‪$GLOBALS['ACCESS_TIME'];
1108  $this->fePreview = 0;
1109  $this->context->setAspect('date', GeneralUtility::makeInstance(DateTimeAspect::class, new \DateTimeImmutable('@' . ‪$GLOBALS['SIM_EXEC_TIME'])));
1110  $this->context->setAspect('visibility', GeneralUtility::makeInstance(VisibilityAspect::class));
1111  }
1112  }
1113 
1119  public function ‪isBackendUserLoggedIn()
1120  {
1121  return (bool)$this->context->getPropertyFromAspect('backend.user', 'isLoggedIn', false);
1122  }
1123 
1130  public function ‪initializeBackendUser()
1131  {
1132  trigger_error('$TSFE->initializeBackendUser() will be removed in TYPO3 v10.0. Extensions should ensure that the BackendAuthenticator middleware is run to load a backend user.', E_USER_DEPRECATED);
1133  // PRE BE_USER HOOK
1134  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'])) {
1135  trigger_error('The "preBeUser" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
1136  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preBeUser'] as $_funcRef) {
1137  $_params = [];
1138  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1139  }
1140  }
1141  $backendUserObject = null;
1142  // If the backend cookie is set,
1143  // we proceed and check if a backend user is logged in.
1145  ‪$GLOBALS['TYPO3_MISC']['microtime_BE_USER_start'] = microtime(true);
1146  $this->‪getTimeTracker()->‪push('Back End user initialized');
1147  $this->beUserLogin = false;
1148  // New backend user object
1149  $backendUserObject = GeneralUtility::makeInstance(FrontendBackendUserAuthentication::class);
1150  $backendUserObject->start();
1151  $backendUserObject->unpack_uc();
1152  if (!empty($backendUserObject->user['uid'])) {
1153  $backendUserObject->fetchGroupData();
1154  }
1155  // Unset the user initialization if any setting / restriction applies
1156  if (!$backendUserObject->checkBackendAccessSettingsFromInitPhp() || empty($backendUserObject->user['uid'])) {
1157  $backendUserObject = null;
1158  }
1159  $this->‪getTimeTracker()->‪pull();
1160  $GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'] = microtime(true);
1161  }
1162  $this->context->setAspect('backend.user', GeneralUtility::makeInstance(UserAspect::class, $backendUserObject));
1163  $this->context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $backendUserObject ? $backendUserObject->workspace : 0));
1164  // POST BE_USER HOOK
1165  if (!empty(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser'])) {
1166  trigger_error('The "postBeUser" hook will be removed in TYPO3 v10.0 in favor of PSR-15. Use a middleware instead.', E_USER_DEPRECATED);
1167  if (is_array(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser'])) {
1168  $_params = [
1169  'BE_USER' => &$backendUserObject
1170  ];
1171  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['postBeUser'] as $_funcRef) {
1172  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1173  }
1174  // Set the aspect again, in case it got changed
1175  $this->context->setAspect('backend.user', GeneralUtility::makeInstance(UserAspect::class, $backendUserObject));
1176  $this->context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $backendUserObject ? $backendUserObject->workspace : 0));
1177  }
1178  }
1179  return $backendUserObject;
1180  }
1181 
1188  public function ‪determineId()
1189  {
1190  // Call pre processing function for id determination
1191  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PreProcessing'] ?? [] as $functionReference) {
1192  $parameters = ['parentObject' => $this];
1193  GeneralUtility::callUserFunction($functionReference, $parameters, $this);
1194  }
1195  // If there is a Backend login we are going to check for any preview settings
1196  $originalFrontendUserGroups = $this->‪applyPreviewSettings($this->‪getBackendUser());
1197  // If the front-end is showing a preview, caching MUST be disabled.
1198  $isPreview = $this->‪isInPreviewMode();
1199  if ($isPreview) {
1200  $this->‪disableCache();
1201  }
1202  // Now, get the id, validate access etc:
1203  $this->‪fetch_the_id();
1204  // Check if backend user has read access to this page. If not, recalculate the id.
1205  if ($this->‪isBackendUserLoggedIn() && $isPreview && !$this->‪getBackendUser()->doesUserHaveAccess($this->page, ‪Permission::PAGE_SHOW)) {
1206  // Resetting
1207  $this->‪clear_preview();
1208  $this->fe_user->user[$this->fe_user->usergroup_column] = $originalFrontendUserGroups;
1209  // Fetching the id again, now with the preview settings reset.
1210  $this->‪fetch_the_id();
1211  }
1212  // Checks if user logins are blocked for a certain branch and if so, will unset user login and re-fetch ID.
1213  $this->loginAllowedInBranch = $this->‪checkIfLoginAllowedInBranch();
1214  // Logins are not allowed, but there is a login, so will we run this.
1215  if (!$this->loginAllowedInBranch && $this->‪isUserOrGroupSet()) {
1216  if ($this->loginAllowedInBranch_mode === 'all') {
1217  // Clear out user and group:
1218  $this->fe_user->hideActiveLogin();
1219  $userGroups = [0, -1];
1220  } else {
1221  $userGroups = [0, -2];
1222  }
1223  $this->context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, $this->fe_user ?: null, $userGroups));
1224  // Fetching the id again, now with the preview settings reset.
1225  $this->‪fetch_the_id();
1226  }
1227  // Final cleaning.
1228  // Make sure it's an integer
1229  $this->id = ($this->contentPid = (int)$this->id);
1230  // Make sure it's an integer
1231  $this->type = (int)$this->type;
1232  // Call post processing function for id determination:
1233  $_params = ['pObj' => &$this];
1234  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc'] ?? [] as $_funcRef) {
1235  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1236  }
1237  }
1238 
1252  protected function ‪applyPreviewSettings($backendUser = null)
1253  {
1254  if (!$backendUser) {
1255  return null;
1256  }
1257  $originalFrontendUserGroup = null;
1258  if ($this->fe_user->user) {
1259  $originalFrontendUserGroup = $this->context->getPropertyFromAspect('frontend.user', 'groupIds');
1260  }
1261 
1262  // The preview flag is set if the current page turns out to be hidden
1263  if ($this->id && $this->‪determineIdIsHiddenPage()) {
1264  $this->fePreview = 1;
1266  $aspect = $this->context->getAspect('visibility');
1267  $newAspect = GeneralUtility::makeInstance(VisibilityAspect::class, true, $aspect->includeHiddenContent(), $aspect->includeDeletedRecords());
1268  $this->context->setAspect('visibility', $newAspect);
1269  }
1270  // The preview flag will be set if an offline workspace will be previewed
1271  if ($this->‪whichWorkspace() > 0) {
1272  $this->fePreview = 1;
1273  }
1274  return $this->fePreview ? $originalFrontendUserGroup : null;
1275  }
1276 
1283  protected function ‪determineIdIsHiddenPage()
1284  {
1285  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
1286  ->getQueryBuilderForTable('pages');
1287  $queryBuilder
1288  ->getRestrictions()
1289  ->removeAll()
1290  ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
1291 
1292  $queryBuilder
1293  ->select('uid', 'hidden', 'starttime', 'endtime')
1294  ->from('pages')
1295  ->where(
1296  $queryBuilder->expr()->gte('pid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
1297  )
1298  ->setMaxResults(1);
1299 
1300  // $this->id always points to the ID of the default language page, so we check
1301  // currentSiteLanguage to determine if we need to fetch a translation
1302  if ($this->‪getCurrentSiteLanguage() instanceof SiteLanguage && $this->‪getCurrentSiteLanguage()->getLanguageId() > 0) {
1303  $languagesToCheck = array_merge([$this->‪getCurrentSiteLanguage()->getLanguageId()], $this->‪getCurrentSiteLanguage()->getFallbackLanguageIds());
1304  // Check for the language and all its fallbacks
1305  $constraint = $queryBuilder->expr()->andX(
1306  $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)),
1307  $queryBuilder->expr()->in('sys_language_uid', $queryBuilder->createNamedParameter(array_filter($languagesToCheck), Connection::PARAM_INT_ARRAY))
1308  );
1309  // If the fallback language Ids also contains the default language, this needs to be considered
1310  if (in_array(0, $languagesToCheck, true)) {
1311  $field = ‪MathUtility::canBeInterpretedAsInteger($this->id) ? 'uid' : 'alias';
1312  $constraint = $queryBuilder->expr()->orX(
1313  $constraint,
1314  // Ensure to also fetch the default record
1315  $queryBuilder->expr()->andX(
1316  $queryBuilder->expr()->eq($field, $queryBuilder->createNamedParameter($this->id)),
1317  $queryBuilder->expr()->in('sys_language_uid', 0)
1318  )
1319  );
1320  }
1321  // Ensure that the translated records are shown first (maxResults is set to 1)
1322  $queryBuilder->orderBy('sys_language_uid', 'DESC');
1323  } else {
1324  $field = ‪MathUtility::canBeInterpretedAsInteger($this->id) ? 'uid' : 'alias';
1325  $constraint = $queryBuilder->expr()->eq($field, $queryBuilder->createNamedParameter($this->id));
1326  }
1327  $queryBuilder->andWhere($constraint);
1328 
1329  ‪$page = $queryBuilder->execute()->fetch();
1330 
1331  if ($this->‪whichWorkspace() > 0) {
1332  // Fetch overlay of page if in workspace and check if it is hidden
1333  $customContext = clone ‪$this->context;
1334  $customContext->‪setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $this->‪whichWorkspace()));
1335  $customContext->setAspect('visibility', GeneralUtility::makeInstance(VisibilityAspect::class));
1336  $pageSelectObject = GeneralUtility::makeInstance(PageRepository::class, $customContext);
1337  $targetPage = $pageSelectObject->getWorkspaceVersionOfRecord($this->‪whichWorkspace(), 'pages', ‪$page['uid']);
1338  // Also checks if the workspace version is NOT hidden but the live version is in fact still hidden
1339  $result = $targetPage === -1 || $targetPage === -2 || (is_array($targetPage) && $targetPage['hidden'] == 0 && ‪$page['hidden'] == 1);
1340  } else {
1341  $result = is_array(‪$page) && (‪$page['hidden'] || ‪$page['starttime'] > ‪$GLOBALS['SIM_EXEC_TIME'] || ‪$page['endtime'] != 0 && ‪$page['endtime'] <= ‪$GLOBALS['SIM_EXEC_TIME']);
1342  }
1343  return $result;
1344  }
1345 
1407  public function ‪fetch_the_id()
1408  {
1409  $timeTracker = $this->‪getTimeTracker();
1410  $timeTracker->push('fetch_the_id initialize/');
1411  // Set the valid usergroups for FE
1412  $this->‪initUserGroups();
1413  // Initialize the PageRepository has to be done after the frontend usergroups are initialized / resolved, as
1414  // frontend group aspect is modified before
1415  $this->sys_page = GeneralUtility::makeInstance(PageRepository::class, $this->context);
1416  // If $this->id is a string, it's an alias
1417  $this->‪checkAndSetAlias();
1418  // The id and type is set to the integer-value - just to be sure...
1419  $this->id = (int)$this->id;
1420  $this->type = (int)$this->type;
1421  $timeTracker->pull();
1422  // We find the first page belonging to the current domain
1423  $timeTracker->push('fetch_the_id domain/');
1424  if (!$this->id) {
1425  if ($this->domainStartPage) {
1426  // If the id was not previously set, set it to the id of the domain.
1427  $this->id = ‪$this->domainStartPage;
1428  } else {
1429  // Find the first 'visible' page in that domain
1430  $rootLevelPages = $this->sys_page->getMenu([0], 'uid', 'sorting', '', false);
1431  if (!empty($rootLevelPages)) {
1432  $theFirstPage = reset($rootLevelPages);
1433  $this->id = $theFirstPage['uid'];
1434  } else {
1435  $message = 'No pages are found on the rootlevel!';
1436  $this->logger->alert($message);
1437  try {
1438  $response = GeneralUtility::makeInstance(ErrorController::class)->unavailableAction(
1439  ‪$GLOBALS['TYPO3_REQUEST'],
1440  $message,
1442  );
1443  throw new ImmediateResponseException($response, 1533931299);
1444  } catch (ServiceUnavailableException $e) {
1445  throw new ServiceUnavailableException($message, 1301648975);
1446  }
1447  }
1448  }
1449  }
1450  $timeTracker->pull();
1451  $timeTracker->push('fetch_the_id rootLine/');
1452  // We store the originally requested id
1453  $this->requestedId = ‪$this->id;
1454  try {
1455  $this->‪getPageAndRootlineWithDomain($this->domainStartPage);
1457  $this->pageNotFound = 1;
1458  }
1459  $timeTracker->pull();
1460  if ($this->pageNotFound) {
1461  switch ($this->pageNotFound) {
1462  case 1:
1463  $response = GeneralUtility::makeInstance(ErrorController::class)->accessDeniedAction(
1464  ‪$GLOBALS['TYPO3_REQUEST'],
1465  'ID was not an accessible page',
1467  );
1468  break;
1469  case 2:
1470  $response = GeneralUtility::makeInstance(ErrorController::class)->accessDeniedAction(
1471  ‪$GLOBALS['TYPO3_REQUEST'],
1472  'Subsection was found and not accessible',
1474  );
1475  break;
1476  case 3:
1477  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
1478  ‪$GLOBALS['TYPO3_REQUEST'],
1479  'ID was outside the domain',
1481  );
1482  break;
1483  case 4:
1484  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
1485  ‪$GLOBALS['TYPO3_REQUEST'],
1486  'The requested page alias does not exist',
1488  );
1489  break;
1490  default:
1491  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
1492  ‪$GLOBALS['TYPO3_REQUEST'],
1493  'Unspecified error',
1495  );
1496  }
1497  throw new ImmediateResponseException($response, 1533931329);
1498  }
1499 
1500  $this->‪setRegisterValueForSysLastChanged($this->page);
1501 
1502  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['fetchPageId-PostProcessing'] ?? [] as $functionReference) {
1503  $parameters = ['parentObject' => $this];
1504  GeneralUtility::callUserFunction($functionReference, $parameters, $this);
1505  }
1506  }
1507 
1556  protected function ‪getPageAndRootline()
1557  {
1558  $this->‪resolveTranslatedPageId();
1559  if (empty($this->page)) {
1560  // If no page, we try to find the page before in the rootLine.
1561  // Page is 'not found' in case the id itself was not an accessible page. code 1
1562  $this->pageNotFound = 1;
1563  try {
1564  $requestedPageRowWithoutGroupCheck = $this->sys_page->getPage($this->id, true);
1565  if (!empty($requestedPageRowWithoutGroupCheck)) {
1566  $this->pageAccessFailureHistory['direct_access'][] = $requestedPageRowWithoutGroupCheck;
1567  }
1568  $this->rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $this->id, $this->MP, $this->context)->get();
1569  if (!empty($this->rootLine)) {
1570  $c = count($this->rootLine) - 1;
1571  while ($c > 0) {
1572  // Add to page access failure history:
1573  $this->pageAccessFailureHistory['direct_access'][] = $this->rootLine[$c];
1574  // Decrease to next page in rootline and check the access to that, if OK, set as page record and ID value.
1575  $c--;
1576  $this->id = $this->rootLine[$c]['uid'];
1577  $this->page = $this->sys_page->getPage($this->id);
1578  if (!empty($this->page)) {
1579  break;
1580  }
1581  }
1582  }
1583  } catch (RootLineException $e) {
1584  $this->rootLine = [];
1585  }
1586  // If still no page...
1587  if (empty($requestedPageRowWithoutGroupCheck) && empty($this->page)) {
1588  $message = 'The requested page does not exist!';
1589  $this->logger->error($message);
1590  try {
1591  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
1592  ‪$GLOBALS['TYPO3_REQUEST'],
1593  $message,
1595  );
1596  throw new ImmediateResponseException($response, 1533931330);
1597  } catch (PageNotFoundException $e) {
1598  throw new PageNotFoundException($message, 1301648780);
1599  }
1600  }
1601  }
1602  // Spacer is not accessible in frontend
1603  if ($this->page['doktype'] == ‪PageRepository::DOKTYPE_SPACER) {
1604  $message = 'The requested page does not exist!';
1605  $this->logger->error($message);
1606  try {
1607  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
1608  ‪$GLOBALS['TYPO3_REQUEST'],
1609  $message,
1611  );
1612  throw new ‪ImmediateResponseException($response, 1533931343);
1613  } catch (‪PageNotFoundException $e) {
1614  throw new ‪PageNotFoundException($message, 1301648781);
1615  }
1616  }
1617  // Is the ID a link to another page??
1618  if ($this->page['doktype'] == ‪PageRepository::DOKTYPE_SHORTCUT) {
1619  // We need to clear MP if the page is a shortcut. Reason is if the short cut goes to another page, then we LEAVE the rootline which the MP expects.
1620  $this->MP = '';
1621  // saving the page so that we can check later - when we know
1622  // about languages - whether we took the correct shortcut or
1623  // whether a translation of the page overwrites the shortcut
1624  // target and we need to follow the new target
1625  $this->originalShortcutPage = ‪$this->page;
1626  $this->page = $this->sys_page->getPageShortcut($this->page['shortcut'], $this->page['shortcut_mode'], $this->page['uid']);
1627  $this->id = $this->page['uid'];
1628  }
1629  // If the page is a mountpoint which should be overlaid with the contents of the mounted page,
1630  // it must never be accessible directly, but only in the mountpoint context. Therefore we change
1631  // the current ID and the user is redirected by checkPageForMountpointRedirect().
1632  if ($this->page['doktype'] == ‪PageRepository::DOKTYPE_MOUNTPOINT && $this->page['mount_pid_ol']) {
1633  $this->originalMountPointPage = ‪$this->page;
1634  $this->page = $this->sys_page->getPage($this->page['mount_pid']);
1635  if (empty($this->page)) {
1636  $message = 'This page (ID ' . $this->originalMountPointPage['uid'] . ') is of type "Mount point" and '
1637  . 'mounts a page which is not accessible (ID ' . $this->originalMountPointPage['mount_pid'] . ').';
1638  throw new ‪PageNotFoundException($message, 1402043263);
1639  }
1640  // If the current page is a shortcut, the MP parameter will be replaced
1641  if ($this->MP === '' || !empty($this->originalShortcutPage)) {
1642  $this->MP = $this->page['uid'] . '-' . $this->originalMountPointPage['uid'];
1643  } else {
1644  $this->MP .= ',' . $this->page['uid'] . '-' . $this->originalMountPointPage['uid'];
1645  }
1646  $this->id = $this->page['uid'];
1647  }
1648  // Gets the rootLine
1649  try {
1650  $this->rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $this->id, $this->MP, $this->context)->get();
1651  } catch (RootLineException $e) {
1652  $this->rootLine = [];
1653  }
1654  // If not rootline we're off...
1655  if (empty($this->rootLine)) {
1656  $message = 'The requested page didn\'t have a proper connection to the tree-root!';
1657  $this->logger->error($message);
1658  try {
1659  $response = GeneralUtility::makeInstance(ErrorController::class)->unavailableAction(
1660  ‪$GLOBALS['TYPO3_REQUEST'],
1661  $message,
1663  );
1664  throw new ImmediateResponseException($response, 1533931350);
1665  } catch (ServiceUnavailableException $e) {
1666  throw new ‪ServiceUnavailableException($message, 1301648167);
1667  }
1668  }
1669  // Checking for include section regarding the hidden/starttime/endtime/fe_user (that is access control of a whole subbranch!)
1670  if ($this->‪checkRootlineForIncludeSection()) {
1671  if (empty($this->rootLine)) {
1672  $message = 'The requested page was not accessible!';
1673  try {
1674  $response = GeneralUtility::makeInstance(ErrorController::class)->unavailableAction(
1675  ‪$GLOBALS['TYPO3_REQUEST'],
1676  $message,
1678  );
1679  throw new ImmediateResponseException($response, 1533931351);
1680  } catch (ServiceUnavailableException $e) {
1681  $this->logger->warning($message);
1682  throw new ServiceUnavailableException($message, 1301648234);
1683  }
1684  } else {
1685  $el = reset($this->rootLine);
1686  $this->id = $el['uid'];
1687  $this->page = $this->sys_page->getPage($this->id);
1688  try {
1689  $this->rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $this->id, $this->MP, $this->context)->get();
1690  } catch (RootLineException $e) {
1691  $this->rootLine = [];
1692  }
1693  }
1694  }
1695  }
1696 
1703  protected function ‪resolveTranslatedPageId()
1704  {
1705  $this->page = $this->sys_page->getPage($this->id);
1706  // Accessed a default language page record, nothing to resolve
1707  if (empty($this->page) || (int)$this->page[‪$GLOBALS['TCA']['pages']['ctrl']['languageField']] === 0) {
1708  return;
1709  }
1710  $languageId = (int)$this->page[‪$GLOBALS['TCA']['pages']['ctrl']['languageField']];
1711  $this->page = $this->sys_page->getPage($this->page[‪$GLOBALS['TCA']['pages']['ctrl']['transOrigPointerField']]);
1712  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, $languageId));
1713  $this->id = $this->page['uid'];
1714  // For common best-practice reasons, this is set, however, will be optional for new routing mechanisms
1715  if (!$this->‪getCurrentSiteLanguage()) {
1716  $_GET['L'] = $languageId;
1717  ‪$GLOBALS['HTTP_GET_VARS']['L'] = $languageId;
1718  }
1719  }
1720 
1737  public function ‪getPageShortcut($SC, $mode, $thisUid, $itera = 20, $pageLog = [], $disableGroupCheck = false)
1738  {
1739  trigger_error('$TSFE->getPageShortcut() has been moved to PageRepository, use the PageRepository directly to call this functionality, as this method will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
1740  return $this->sys_page->getPageShortcut($SC, $mode, $thisUid, $itera, $pageLog, $disableGroupCheck);
1741  }
1742 
1767  protected function ‪checkRootlineForIncludeSection(): bool
1768  {
1769  $c = count($this->rootLine);
1770  $removeTheRestFlag = false;
1771  for ($a = 0; $a < $c; $a++) {
1772  if (!$this->‪checkPagerecordForIncludeSection($this->rootLine[$a])) {
1773  // Add to page access failure history and mark the page as not found
1774  // Keep the rootline however to trigger an access denied error instead of a service unavailable error
1775  $this->pageAccessFailureHistory['sub_section'][] = $this->rootLine[$a];
1776  $this->pageNotFound = 2;
1777  }
1778 
1779  if ((int)$this->rootLine[$a]['doktype'] === ‪PageRepository::DOKTYPE_BE_USER_SECTION) {
1780  // If there is a backend user logged in, check if they have read access to the page:
1781  if ($this->‪isBackendUserLoggedIn()) {
1782  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
1783  ->getQueryBuilderForTable('pages');
1784 
1785  $queryBuilder
1786  ->getRestrictions()
1787  ->removeAll();
1788 
1789  $row = $queryBuilder
1790  ->select('uid')
1791  ->from('pages')
1792  ->where(
1793  $queryBuilder->expr()->eq(
1794  'uid',
1795  $queryBuilder->createNamedParameter($this->id, \PDO::PARAM_INT)
1796  ),
1797  $this->getBackendUser()->getPagePermsClause(‪Permission::PAGE_SHOW)
1798  )
1799  ->execute()
1800  ->fetch();
1801 
1802  // versionOL()?
1803  if (!$row) {
1804  // If there was no page selected, the user apparently did not have read access to the current PAGE (not position in rootline) and we set the remove-flag...
1805  $removeTheRestFlag = true;
1806  }
1807  } else {
1808  // Don't go here, if there is no backend user logged in.
1809  $removeTheRestFlag = true;
1810  }
1811  } elseif ((int)$this->rootLine[$a]['doktype'] === ‪PageRepository::DOKTYPE_RECYCLER) {
1812  // page is in a recycler
1813  $removeTheRestFlag = true;
1814  }
1815  if ($removeTheRestFlag) {
1816  // Page is 'not found' in case a subsection was found and not accessible, code 2
1817  $this->pageNotFound = 2;
1818  unset($this->rootLine[$a]);
1819  }
1820  }
1821  return $removeTheRestFlag;
1822  }
1823 
1834  public function ‪checkEnableFields($row, $bypassGroupCheck = false)
1835  {
1836  $_params = ['pObj' => $this, 'row' => &$row, 'bypassGroupCheck' => &$bypassGroupCheck];
1837  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_checkEnableFields'] ?? [] as $_funcRef) {
1838  // Call hooks: If one returns FALSE, method execution is aborted with result "This record is not available"
1839  $return = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1840  if ($return === false) {
1841  return false;
1842  }
1843  }
1844  if ((!$row['hidden'] || $this->context->getPropertyFromAspect('visibility', 'includeHiddenPages', false))
1845  && $row['starttime'] <= ‪$GLOBALS['SIM_ACCESS_TIME']
1846  && ($row['endtime'] == 0 || $row['endtime'] > ‪$GLOBALS['SIM_ACCESS_TIME'])
1847  && ($bypassGroupCheck || $this->checkPageGroupAccess($row))) {
1848  return true;
1849  }
1850  return false;
1851  }
1852 
1860  public function ‪checkPageGroupAccess($row)
1861  {
1863  $userAspect = $this->context->getAspect('frontend.user');
1864  $pageGroupList = explode(',', $row['fe_group'] ?: 0);
1865  return count(array_intersect($userAspect->getGroupIds(), $pageGroupList)) > 0;
1866  }
1867 
1883  public function ‪checkPagerecordForIncludeSection(array $row): bool
1884  {
1885  return !$row['extendToSubpages'] || $this->‪checkEnableFields($row);
1886  }
1887 
1893  public function ‪checkIfLoginAllowedInBranch()
1894  {
1895  // Initialize:
1896  $c = count($this->rootLine);
1897  $loginAllowed = true;
1898  // Traverse root line from root and outwards:
1899  for ($a = 0; $a < $c; $a++) {
1900  // If a value is set for login state:
1901  if ($this->rootLine[$a]['fe_login_mode'] > 0) {
1902  // Determine state from value:
1903  if ((int)$this->rootLine[$a]['fe_login_mode'] === 1) {
1904  $loginAllowed = false;
1905  $this->loginAllowedInBranch_mode = 'all';
1906  } elseif ((int)$this->rootLine[$a]['fe_login_mode'] === 3) {
1907  $loginAllowed = false;
1908  $this->loginAllowedInBranch_mode = 'groups';
1909  } else {
1910  $loginAllowed = true;
1911  }
1912  }
1913  }
1914  return $loginAllowed;
1915  }
1916 
1923  public function ‪getPageAccessFailureReasons(string $failureReasonCode = null)
1924  {
1925  ‪$output = [];
1926  if ($failureReasonCode) {
1927  ‪$output['code'] = $failureReasonCode;
1928  }
1929  $combinedRecords = array_merge(is_array($this->pageAccessFailureHistory['direct_access']) ? $this->pageAccessFailureHistory['direct_access'] : [['fe_group' => 0]], is_array($this->pageAccessFailureHistory['sub_section']) ? $this->pageAccessFailureHistory['sub_section'] : []);
1930  if (!empty($combinedRecords)) {
1931  foreach ($combinedRecords as $k => $pagerec) {
1932  // If $k=0 then it is the very first page the original ID was pointing at and that will get a full check of course
1933  // If $k>0 it is parent pages being tested. They are only significant for the access to the first page IF they had the extendToSubpages flag set, hence checked only then!
1934  if (!$k || $pagerec['extendToSubpages']) {
1935  if ($pagerec['hidden']) {
1936  ‪$output['hidden'][$pagerec['uid']] = true;
1937  }
1938  if ($pagerec['starttime'] > ‪$GLOBALS['SIM_ACCESS_TIME']) {
1939  ‪$output['starttime'][$pagerec['uid']] = $pagerec['starttime'];
1940  }
1941  if ($pagerec['endtime'] != 0 && $pagerec['endtime'] <= ‪$GLOBALS['SIM_ACCESS_TIME']) {
1942  ‪$output['endtime'][$pagerec['uid']] = $pagerec['endtime'];
1943  }
1944  if (!$this->‪checkPageGroupAccess($pagerec)) {
1945  ‪$output['fe_group'][$pagerec['uid']] = $pagerec['fe_group'];
1946  }
1947  }
1948  }
1949  }
1950  return ‪$output;
1951  }
1952 
1961  {
1962  $this->‪getPageAndRootline();
1963  // Checks if the $domain-startpage is in the rootLine. This is necessary so that references to page-id's from other domains are not possible.
1964  if (‪$domainStartPage && is_array($this->rootLine) && $this->rootLine !== []) {
1965  $idFound = false;
1966  foreach ($this->rootLine as $key => $val) {
1967  if ($val['uid'] == ‪$domainStartPage) {
1968  $idFound = true;
1969  break;
1970  }
1971  }
1972  if (!$idFound) {
1973  // Page is 'not found' in case the id was outside the domain, code 3
1974  $this->pageNotFound = 3;
1975  $this->id = ‪$domainStartPage;
1976  // re-get the page and rootline if the id was not found.
1977  $this->‪getPageAndRootline();
1978  }
1979  }
1980  }
1981 
1989  public function ‪pageUnavailableAndExit($reason = '', $header = '')
1990  {
1991  trigger_error('$TSFE->pageUnavailableAndExit() will be removed in TYPO3 v10.0. Use TYPO3\'s ErrorController with Request/Response objects instead.', E_USER_DEPRECATED);
1992  $header = $header ?: ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_handling_statheader'];
1993  $this->‪pageUnavailableHandler($GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_handling'], $header, $reason);
1994  die;
1995  }
1996 
2004  public function ‪pageNotFoundAndExit($reason = '', $header = '')
2005  {
2006  trigger_error('$TSFE->pageNotFoundAndExit() will be removed in TYPO3 v10.0. Use TYPO3\'s ErrorController with Request/Response objects instead.', E_USER_DEPRECATED);
2007  $header = $header ?: ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_statheader'];
2008  $this->‪pageNotFoundHandler($GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'], $header, $reason);
2009  die;
2010  }
2011 
2019  public function ‪checkPageUnavailableHandler()
2020  {
2021  trigger_error('$TSFE->checkPageUnavailableHandler() will be removed in TYPO3 v10.0. Use TYPO3\'s ErrorController with Request/Response objects instead.', E_USER_DEPRECATED);
2022  if (
2023  ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['pageUnavailable_handling']
2024  && !GeneralUtility::cmpIP(
2025  GeneralUtility::getIndpEnv('REMOTE_ADDR'),
2026  ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']
2027  )
2028  ) {
2029  $checkPageUnavailableHandler = true;
2030  } else {
2031  $checkPageUnavailableHandler = false;
2032  }
2033  return $checkPageUnavailableHandler;
2034  }
2035 
2044  public function ‪pageUnavailableHandler($code, $header, $reason)
2045  {
2046  trigger_error('$TSFE->pageUnavailableHandler() will be removed in TYPO3 v10.0. Use TYPO3\'s ErrorController with Request/Response objects instead.', E_USER_DEPRECATED);
2047  $this->‪pageErrorHandler($code, $header, $reason);
2048  }
2049 
2058  public function ‪pageNotFoundHandler($code, $header = '', $reason = '')
2059  {
2060  trigger_error('$TSFE->pageNotFoundHandler() will be removed in TYPO3 v10.0. Use TYPO3\'s ErrorController with Request/Response objects instead.', E_USER_DEPRECATED);
2061  $this->‪pageErrorHandler($code, $header, $reason);
2062  }
2063 
2074  public function ‪pageErrorHandler($code, $header = '', $reason = '')
2075  {
2076  trigger_error('$TSFE->pageErrorHandler() will be removed in TYPO3 v10.0. Use TYPO3\'s ErrorController with Request/Response objects instead.', E_USER_DEPRECATED);
2077  // Issue header in any case:
2078  if ($header) {
2079  $headerArr = preg_split('/\\r|\\n/', $header, -1, PREG_SPLIT_NO_EMPTY);
2080  foreach ($headerArr as $header) {
2081  header($header);
2082  }
2083  }
2084  // Create response:
2085  // Simply boolean; Just shows TYPO3 error page with reason:
2086  if (strtolower($code) === 'true' || (string)$code === '1' || is_bool($code)) {
2087  echo GeneralUtility::makeInstance(ErrorPageController::class)->errorAction(
2088  'Page Not Found',
2089  'The page did not exist or was inaccessible.' . ($reason ? ' Reason: ' . $reason : '')
2090  );
2091  } elseif (GeneralUtility::isFirstPartOfStr($code, 'USER_FUNCTION:')) {
2092  $funcRef = trim(substr($code, 14));
2093  $params = [
2094  'currentUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
2095  'reasonText' => $reason,
2096  'pageAccessFailureReasons' => $this->‪getPageAccessFailureReasons()
2097  ];
2098  try {
2099  echo GeneralUtility::callUserFunction($funcRef, $params, $this);
2100  } catch (\Exception $e) {
2101  throw new \RuntimeException('Error: 404 page by USER_FUNCTION "' . $funcRef . '" failed.', 1509296032, $e);
2102  }
2103  } elseif (GeneralUtility::isFirstPartOfStr($code, 'READFILE:')) {
2104  $readFile = GeneralUtility::getFileAbsFileName(trim(substr($code, 9)));
2105  if (@is_file($readFile)) {
2106  echo str_replace(
2107  [
2108  '###CURRENT_URL###',
2109  '###REASON###'
2110  ],
2111  [
2112  GeneralUtility::getIndpEnv('REQUEST_URI'),
2113  htmlspecialchars($reason)
2114  ],
2115  file_get_contents($readFile)
2116  );
2117  } else {
2118  throw new \RuntimeException('Configuration Error: 404 page "' . $readFile . '" could not be found.', 1294587214);
2119  }
2120  } elseif (GeneralUtility::isFirstPartOfStr($code, 'REDIRECT:')) {
2121  ‪HttpUtility::redirect(substr($code, 9));
2122  } elseif ($code !== '') {
2123  // Check if URL is relative
2124  $url_parts = parse_url($code);
2125  // parse_url could return an array without the key "host", the empty check works better than strict check
2126  if (empty($url_parts['host'])) {
2127  $url_parts['host'] = GeneralUtility::getIndpEnv('HTTP_HOST');
2128  if ($code[0] === '/') {
2129  $code = GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST') . $code;
2130  } else {
2131  $code = GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR') . $code;
2132  }
2133  $checkBaseTag = false;
2134  } else {
2135  $checkBaseTag = true;
2136  }
2137  // Check recursion
2138  if ($code == GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')) {
2139  if ($reason == '') {
2140  $reason = 'Page cannot be found.';
2141  }
2142  $reason .= LF . LF . 'Additionally, ' . $code . ' was not found while trying to retrieve the error document.';
2143  throw new \RuntimeException(nl2br(htmlspecialchars($reason)), 1294587215);
2144  }
2145  // Prepare headers
2146  $headerArr = [
2147  'User-agent: ' . GeneralUtility::getIndpEnv('HTTP_USER_AGENT'),
2148  'Referer: ' . GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL')
2149  ];
2150  $report = [];
2151  $res = GeneralUtility::getUrl($code, 1, $headerArr, $report);
2152  if ((int)$report['error'] !== 0 && (int)$report['error'] !== 200) {
2153  throw new \RuntimeException('Failed to fetch error page "' . $code . '", reason: ' . $report['message'], 1509296606);
2154  }
2155  // Header and content are separated by an empty line
2156  list($header, ‪$content) = explode(CRLF . CRLF, $res, 2);
2157  ‪$content .= CRLF;
2158  if (false === $res) {
2159  // Last chance -- redirect
2160  ‪HttpUtility::redirect($code);
2161  } else {
2162  // Forward these response headers to the client
2163  $forwardHeaders = [
2164  'Content-Type:'
2165  ];
2166  $headerArr = preg_split('/\\r|\\n/', $header, -1, PREG_SPLIT_NO_EMPTY);
2167  foreach ($headerArr as $header) {
2168  foreach ($forwardHeaders as $h) {
2169  if (preg_match('/^' . $h . '/', $header)) {
2170  header($header);
2171  }
2172  }
2173  }
2174  // Put <base> if necessary
2175  if ($checkBaseTag) {
2176  // If content already has <base> tag, we do not need to do anything
2177  if (false === stristr(‪$content, '<base ')) {
2178  // Generate href for base tag
2179  $base = $url_parts['scheme'] . '://';
2180  if ($url_parts['user'] != '') {
2181  $base .= $url_parts['user'];
2182  if ($url_parts['pass'] != '') {
2183  $base .= ':' . $url_parts['pass'];
2184  }
2185  $base .= '@';
2186  }
2187  $base .= $url_parts['host'];
2188  // Add path portion skipping possible file name
2189  $base .= preg_replace('/(.*\\/)[^\\/]*/', '${1}', $url_parts['path']);
2190  // Put it into content (generate also <head> if necessary)
2191  $replacement = LF . '<base href="' . htmlentities($base) . '" />' . LF;
2192  if (stristr(‪$content, '<head>')) {
2193  ‪$content = preg_replace('/(<head>)/i', '\\1' . $replacement, ‪$content);
2194  } else {
2195  ‪$content = preg_replace('/(<html[^>]*>)/i', '\\1<head>' . $replacement . '</head>', ‪$content);
2196  }
2197  }
2198  }
2199  // Output the content
2200  echo ‪$content;
2201  }
2202  } else {
2203  echo GeneralUtility::makeInstance(ErrorPageController::class)->errorAction(
2204  'Page Not Found',
2205  $reason ? 'Reason: ' . $reason : 'Page cannot be found.'
2206  );
2207  }
2208  die;
2209  }
2210 
2215  protected function ‪checkAndSetAlias()
2216  {
2217  if ($this->id && !‪MathUtility::canBeInterpretedAsInteger($this->id)) {
2218  $aid = $this->sys_page->getPageIdFromAlias($this->id);
2219  if ($aid) {
2220  $this->id = $aid;
2221  } else {
2222  $this->pageNotFound = 4;
2223  }
2224  }
2225  }
2226 
2233  protected function ‪mergingWithGetVars($GET_VARS)
2234  {
2235  if (is_array($GET_VARS)) {
2236  // Getting $_GET var, unescaped.
2237  $realGet = GeneralUtility::_GET();
2238  if (!is_array($realGet)) {
2239  $realGet = [];
2240  }
2241  // Merge new values on top:
2242  ‪ArrayUtility::mergeRecursiveWithOverrule($realGet, $GET_VARS);
2243  // Write values back to $_GET
2244  $_GET = $realGet;
2245  ‪$GLOBALS['HTTP_GET_VARS'] = $realGet;
2246  // Setting these specifically (like in the init-function):
2247  if (isset($GET_VARS['type'])) {
2248  $this->type = (int)$GET_VARS['type'];
2249  }
2250  if (isset($GET_VARS['cHash'])) {
2251  $this->cHash = (string)$GET_VARS['cHash'];
2252  }
2253  if (isset($GET_VARS['MP'])) {
2254  $this->MP = ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids'] ? $GET_VARS['MP'] : '';
2255  }
2256  if (isset($GET_VARS['no_cache']) && $GET_VARS['no_cache']) {
2257  $this->‪set_no_cache('no_cache is requested via GET parameter');
2258  }
2259  }
2260  }
2261 
2262  /********************************************
2263  *
2264  * Template and caching related functions.
2265  *
2266  *******************************************/
2276  public function ‪makeCacheHash()
2277  {
2278  trigger_error('$TSFE->makeCacheHash() will be removed in TYPO3 v10.0, as this is now handled in the PSR-15 middleware.', E_USER_DEPRECATED);
2279  // No need to test anything if caching was already disabled.
2280  if ($this->no_cache && !‪$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']) {
2281  return;
2282  }
2283  $GET = GeneralUtility::_GET();
2284  if ($this->cHash !== '' && is_array($GET)) {
2285  // Make sure we use the page uid and not the page alias
2286  $GET['id'] = ‪$this->id;
2287  $this->cHash_array = $this->cacheHash->getRelevantParameters(‪HttpUtility::buildQueryString($GET));
2288  $cHash_calc = $this->cacheHash->calculateCacheHash($this->cHash_array);
2289  if (!hash_equals($cHash_calc, $this->cHash)) {
2290  if (‪$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']) {
2291  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
2292  ‪$GLOBALS['TYPO3_REQUEST'],
2293  'Request parameters could not be validated (&cHash comparison failed)',
2295  );
2296  throw new ImmediateResponseException($response, 1533931352);
2297  }
2298  $this->‪disableCache();
2299  $this->‪getTimeTracker()->‪setTSlogMessage('The incoming cHash "' . $this->cHash . '" and calculated cHash "' . $cHash_calc . '" did not match, so caching was disabled. The fieldlist used was "' . implode(',', array_keys($this->cHash_array)) . '"', 2);
2300  }
2301  } elseif (is_array($GET)) {
2302  // No cHash is set, check if that is correct
2303  if ($this->cacheHash->doParametersRequireCacheHash(‪HttpUtility::buildQueryString($GET))) {
2304  $this->‪reqCHash();
2305  }
2306  }
2307  }
2308 
2315  public function ‪reqCHash()
2316  {
2317  $skip = $this->pageArguments !== null && empty($this->pageArguments->getDynamicArguments());
2318  if ($this->cHash !== '' || $skip) {
2319  return;
2320  }
2321  if ($this->pageArguments) {
2322  $queryParams = $this->pageArguments->getDynamicArguments();
2323  $queryParams['id'] = $this->pageArguments->getPageId();
2324  $argumentsThatWouldRequireCacheHash = $this->cacheHash
2325  ->getRelevantParameters(‪HttpUtility::buildQueryString($queryParams));
2326  if (empty($argumentsThatWouldRequireCacheHash)) {
2327  return;
2328  }
2329  }
2330  if (‪$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFoundOnCHashError']) {
2331  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
2332  ‪$GLOBALS['TYPO3_REQUEST'],
2333  'Request parameters could not be validated (&cHash empty)',
2335  );
2336  throw new ImmediateResponseException($response, 1533931354);
2337  }
2338  $this->‪disableCache();
2339  $this->‪getTimeTracker()->‪setTSlogMessage('TSFE->reqCHash(): No &cHash parameter was sent for GET vars though required so caching is disabled', 2);
2340  }
2341 
2346  public function ‪setPageArguments(PageArguments ‪$pageArguments)
2347  {
2348  $this->pageArguments = ‪$pageArguments;
2349  }
2350 
2355  public function ‪initTemplate()
2356  {
2357  trigger_error('$TSFE->initTemplate() will be removed in TYPO3 v10.0. Instantiating TemplateService is done implicitly on usage within $TSFE directly.', E_USER_DEPRECATED);
2358  $this->tmpl = GeneralUtility::makeInstance(TemplateService::class, $this->context);
2359  }
2360 
2368  public function ‪getFromCache()
2369  {
2370  // clearing the content-variable, which will hold the pagecontent
2371  $this->content = '';
2372  // Unsetting the lowlevel config
2373  $this->config = [];
2374  $this->cacheContentFlag = false;
2375 
2376  if ($this->no_cache) {
2377  return;
2378  }
2379 
2380  if (!($this->tmpl instanceof TemplateService)) {
2381  $this->tmpl = GeneralUtility::makeInstance(TemplateService::class, $this->context);
2382  }
2383 
2384  $pageSectionCacheContent = $this->tmpl->getCurrentPageData();
2385  if (!is_array($pageSectionCacheContent)) {
2386  // Nothing in the cache, we acquire an "exclusive lock" for the key now.
2387  // We use the Registry to store this lock centrally,
2388  // but we protect the access again with a global exclusive lock to avoid race conditions
2390  $this->‪acquireLock('pagesection', $this->id . '::' . $this->MP);
2391  //
2392  // from this point on we're the only one working on that page ($key)
2393  //
2394 
2395  // query the cache again to see if the page data are there meanwhile
2396  $pageSectionCacheContent = $this->tmpl->getCurrentPageData();
2397  if (is_array($pageSectionCacheContent)) {
2398  // we have the content, nice that some other process did the work for us already
2399  $this->‪releaseLock('pagesection');
2400  }
2401  // We keep the lock set, because we are the ones generating the page now and filling the cache.
2402  // This indicates that we have to release the lock later in releaseLocks()
2403  }
2405  if (is_array($pageSectionCacheContent)) {
2406  // BE CAREFUL to change the content of the cc-array. This array is serialized and an md5-hash based on this is used for caching the page.
2407  // If this hash is not the same in here in this section and after page-generation, then the page will not be properly cached!
2408  // This array is an identification of the template. If $this->all is empty it's because the template-data is not cached, which it must be.
2409  $pageSectionCacheContent = $this->tmpl->matching($pageSectionCacheContent);
2410  ksort($pageSectionCacheContent);
2411  $this->all = $pageSectionCacheContent;
2412  }
2413  unset($pageSectionCacheContent);
2414 
2415  // Look for page in cache only if a shift-reload is not sent to the server.
2416  $lockHash = $this->‪getLockHash();
2417  if (!$this->‪headerNoCache()) {
2418  if ($this->all) {
2419  // we got page section information
2420  $this->newHash = $this->‪getHash();
2421  $this->‪getTimeTracker()->‪push('Cache Row');
2422  $row = $this->‪getFromCache_queryRow();
2423  if (!is_array($row)) {
2424  // nothing in the cache, we acquire an exclusive lock now
2425 
2426  $this->‪acquireLock('pages', $lockHash);
2427  //
2428  // from this point on we're the only one working on that page ($lockHash)
2429  //
2430 
2431  // query the cache again to see if the data are there meanwhile
2432  $row = $this->‪getFromCache_queryRow();
2433  if (is_array($row)) {
2434  // we have the content, nice that some other process did the work for us
2435  $this->‪releaseLock('pages');
2436  }
2437  // We keep the lock set, because we are the ones generating the page now and filling the cache.
2438  // This indicates that we have to release the lock later in releaseLocks()
2439  }
2440  if (is_array($row)) {
2441  // we have data from cache
2442 
2443  // Call hook when a page is retrieved from cache:
2444  $_params = ['pObj' => &$this, 'cache_pages_row' => &$row];
2445  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageLoadedFromCache'] ?? [] as $_funcRef) {
2446  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
2447  }
2448  // Fetches the lowlevel config stored with the cached data
2449  $this->config = $row['cache_data'];
2450  // Getting the content
2451  $this->content = $row['content'];
2452  // Setting flag, so we know, that some cached content has been loaded
2453  $this->cacheContentFlag = true;
2454  $this->cacheExpires = $row['expires'];
2455  // Restore the current tags as they can be retrieved by getPageCacheTags()
2456  $this->pageCacheTags = $row['cacheTags'] ?? [];
2457 
2458  // Restore page title information, this is needed to generate the page title for
2459  // partially cached pages.
2460  $this->page['title'] = $row['pageTitleInfo']['title'];
2461  $this->altPageTitle = $row['pageTitleInfo']['altPageTitle'];
2462  $this->indexedDocTitle = $row['pageTitleInfo']['indexedDocTitle'];
2463 
2464  if (isset($this->config['config']['debug'])) {
2465  $debugCacheTime = (bool)$this->config['config']['debug'];
2466  } else {
2467  $debugCacheTime = !empty(‪$GLOBALS['TYPO3_CONF_VARS']['FE']['debug']);
2468  }
2469  if ($debugCacheTime) {
2470  $dateFormat = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
2471  $timeFormat = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
2472  $this->content .= LF . '<!-- Cached page generated ' . date($dateFormat . ' ' . $timeFormat, $row['tstamp']) . '. Expires ' . date($dateFormat . ' ' . $timeFormat, $row['expires']) . ' -->';
2473  }
2474  }
2475  $this->‪getTimeTracker()->‪pull();
2476 
2477  return;
2478  }
2479  }
2480  // the user forced rebuilding the page cache or there was no pagesection information
2481  // get a lock for the page content so other processes will not interrupt the regeneration
2482  $this->‪acquireLock('pages', $lockHash);
2483  }
2484 
2490  public function ‪getFromCache_queryRow()
2491  {
2492  $this->‪getTimeTracker()->‪push('Cache Query');
2493  $row = $this->pageCache->get($this->newHash);
2494  $this->‪getTimeTracker()->‪pull();
2495  return $row;
2496  }
2505  public function ‪headerNoCache()
2506  {
2507  $disableAcquireCacheData = false;
2508  if ($this->‪isBackendUserLoggedIn()) {
2509  if (strtolower($_SERVER['HTTP_CACHE_CONTROL']) === 'no-cache' || strtolower($_SERVER['HTTP_PRAGMA']) === 'no-cache') {
2510  $disableAcquireCacheData = true;
2511  }
2512  }
2513  // Call hook for possible by-pass of requiring of page cache (for recaching purpose)
2514  $_params = ['pObj' => &$this, 'disableAcquireCacheData' => &$disableAcquireCacheData];
2515  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['headerNoCache'] ?? [] as $_funcRef) {
2516  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
2517  }
2518  return $disableAcquireCacheData;
2519  }
2520 
2529  protected function ‪getHash()
2530  {
2531  return md5($this->‪createHashBase(false));
2532  }
2533 
2541  protected function ‪getLockHash()
2542  {
2543  $lockHash = $this->‪createHashBase(true);
2544  return md5($lockHash);
2545  }
2546 
2557  protected function ‪createHashBase($createLockHashBase = false)
2558  {
2559  // Ensure the language base is used for the hash base calculation as well, otherwise TypoScript and page-related rendering
2560  // is not cached properly as we don't have any language-specific conditions anymore
2561  $siteBase = $this->‪getCurrentSiteLanguage() ? (string)$this->‪getCurrentSiteLanguage()->getBase() : '';
2562 
2563  // Fetch the list of user groups
2565  $userAspect = $this->context->getAspect('frontend.user');
2566  $hashParameters = [
2567  'id' => (int)$this->id,
2568  'type' => (int)‪$this->type,
2569  'gr_list' => (string)implode(',', $userAspect->getGroupIds()),
2570  'MP' => (string)‪$this->MP,
2571  'siteBase' => $siteBase,
2572  // cHash_array includes dynamic route arguments (if route was resolved)
2573  'cHash' => ‪$this->cHash_array,
2574  // additional variation trigger for static routes
2575  'staticRouteArguments' => $this->pageArguments !== null ? $this->pageArguments->getStaticArguments() : null,
2576  'domainStartPage' => ‪$this->domainStartPage
2577  ];
2578  // Include the template information if we shouldn't create a lock hash
2579  if (!$createLockHashBase) {
2580  $hashParameters['all'] = ‪$this->all;
2581  }
2582  // Call hook to influence the hash calculation
2583  $_params = [
2584  'hashParameters' => &$hashParameters,
2585  'createLockHashBase' => $createLockHashBase
2586  ];
2587  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'] ?? [] as $_funcRef) {
2588  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
2589  }
2590  return serialize($hashParameters);
2591  }
2592 
2598  public function ‪getConfigArray()
2599  {
2600  if (!($this->tmpl instanceof TemplateService)) {
2601  $this->tmpl = GeneralUtility::makeInstance(TemplateService::class, $this->context);
2602  }
2603 
2604  // If config is not set by the cache (which would be a major mistake somewhere) OR if INTincScripts-include-scripts have been registered, then we must parse the template in order to get it
2605  if (empty($this->config) || is_array($this->config['INTincScript']) || $this->forceTemplateParsing) {
2606  $timeTracker = $this->‪getTimeTracker();
2607  $timeTracker->push('Parse template');
2608  // Force parsing, if set?:
2609  $this->tmpl->forceTemplateParsing = ‪$this->forceTemplateParsing;
2610  // Start parsing the TS template. Might return cached version.
2611  $this->tmpl->start($this->rootLine);
2612  $timeTracker->pull();
2613  // At this point we have a valid pagesection_cache (generated in $this->tmpl->start()),
2614  // so let all other processes proceed now. (They are blocked at the pagessection_lock in getFromCache())
2615  $this->‪releaseLock('pagesection');
2616  if ($this->tmpl->loaded) {
2617  $timeTracker->push('Setting the config-array');
2618  // toplevel - objArrayName
2619  $this->sPre = $this->tmpl->setup['types.'][‪$this->type];
2620  $this->pSetup = $this->tmpl->setup[$this->sPre . '.'];
2621  if (!is_array($this->pSetup)) {
2622  $message = 'The page is not configured! [type=' . $this->type . '][' . $this->sPre . '].';
2623  $this->logger->alert($message);
2624  try {
2625  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
2626  ‪$GLOBALS['TYPO3_REQUEST'],
2627  $message,
2629  );
2630  throw new ImmediateResponseException($response, 1533931374);
2631  } catch (PageNotFoundException $e) {
2632  $explanation = 'This means that there is no TypoScript object of type PAGE with typeNum=' . $this->type . ' configured.';
2633  throw new ‪ServiceUnavailableException($message . ' ' . $explanation, 1294587217);
2634  }
2635  } else {
2636  if (!isset($this->config['config'])) {
2637  $this->config['config'] = [];
2638  }
2639  // Filling the config-array, first with the main "config." part
2640  if (is_array($this->tmpl->setup['config.'])) {
2641  ‪ArrayUtility::mergeRecursiveWithOverrule($this->tmpl->setup['config.'], $this->config['config']);
2642  $this->config['config'] = $this->tmpl->setup['config.'];
2643  }
2644  // override it with the page/type-specific "config."
2645  if (is_array($this->pSetup['config.'])) {
2646  ‪ArrayUtility::mergeRecursiveWithOverrule($this->config['config'], $this->pSetup['config.']);
2647  }
2648  // @deprecated since TYPO3 v9, can be removed in TYPO3 v10.0
2649  if ($this->config['config']['typolinkCheckRootline']) {
2650  $this->‪logDeprecatedTyposcript('config.typolinkCheckRootline', 'The functionality is always enabled since TYPO3 v9 and can be removed from your TypoScript code');
2651  }
2652  // Set default values for removeDefaultJS and inlineStyle2TempFile so CSS and JS are externalized if compatversion is higher than 4.0
2653  if (!isset($this->config['config']['removeDefaultJS'])) {
2654  $this->config['config']['removeDefaultJS'] = 'external';
2655  }
2656  if (!isset($this->config['config']['inlineStyle2TempFile'])) {
2657  $this->config['config']['inlineStyle2TempFile'] = 1;
2658  }
2659 
2660  if (!isset($this->config['config']['compressJs'])) {
2661  $this->config['config']['compressJs'] = 0;
2662  }
2663  // Processing for the config_array:
2664  $this->config['rootLine'] = $this->tmpl->rootLine;
2665  // Class for render Header and Footer parts
2666  if ($this->pSetup['pageHeaderFooterTemplateFile']) {
2667  try {
2668  $file = GeneralUtility::makeInstance(FilePathSanitizer::class)
2669  ->sanitize((string)$this->pSetup['pageHeaderFooterTemplateFile']);
2670  $this->pageRenderer->setTemplateFile($file);
2671  } catch (\‪TYPO3\CMS\Core\Resource\Exception $e) {
2672  // do nothing
2673  }
2674  }
2675  }
2676  $timeTracker->pull();
2677  } else {
2678  $message = 'No TypoScript template found!';
2679  $this->logger->alert($message);
2680  try {
2681  $response = GeneralUtility::makeInstance(ErrorController::class)->unavailableAction(
2682  ‪$GLOBALS['TYPO3_REQUEST'],
2683  $message,
2685  );
2686  throw new ImmediateResponseException($response, 1533931380);
2687  } catch (ServiceUnavailableException $e) {
2688  throw new ServiceUnavailableException($message, 1294587218);
2689  }
2690  }
2691  }
2692 
2693  // No cache
2694  // Set $this->no_cache TRUE if the config.no_cache value is set!
2695  if ($this->config['config']['no_cache']) {
2696  $this->‪set_no_cache('config.no_cache is set', true);
2697  }
2698  // Merge GET with defaultGetVars
2699  // Please note that this code will get removed in TYPO3 v10.0 as it is done in the PSR-15 middleware.
2700  if (!empty($this->config['config']['defaultGetVars.'])) {
2701  $modifiedGetVars = GeneralUtility::removeDotsFromTS($this->config['config']['defaultGetVars.']);
2702  ‪ArrayUtility::mergeRecursiveWithOverrule($modifiedGetVars, GeneralUtility::_GET());
2703  $_GET = $modifiedGetVars;
2704  ‪$GLOBALS['HTTP_GET_VARS'] = $modifiedGetVars;
2705  }
2706 
2707  // Auto-configure settings when a site is configured
2708  if ($this->‪getCurrentSiteLanguage()) {
2709  $this->config['config']['absRefPrefix'] = $this->config['config']['absRefPrefix'] ?? 'auto';
2710  }
2711 
2712  $this->‪setUrlIdToken();
2713 
2714  // Hook for postProcessing the configuration array
2715  $params = ['config' => &$this->config['config']];
2716  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['configArrayPostProc'] ?? [] as $funcRef) {
2717  GeneralUtility::callUserFunction($funcRef, $params, $this);
2718  }
2719  }
2720 
2721  /********************************************
2722  *
2723  * Further initialization and data processing
2724  *
2725  *******************************************/
2726 
2733  public function ‪settingLanguage()
2734  {
2735  $_params = [];
2736  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_preProcess'] ?? [] as $_funcRef) {
2737  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
2738  }
2739 
2741 
2742  $siteLanguage = $this->‪getCurrentSiteLanguage();
2743 
2744  // Initialize charset settings etc.
2745  if ($siteLanguage) {
2746  $languageKey = $siteLanguage->getTypo3Language();
2747  } else {
2748  $languageKey = $this->config['config']['language'] ?? 'default';
2749  }
2750  $this->lang = $languageKey;
2751  $this->‪setOutputLanguage($languageKey);
2752 
2753  // Rendering charset of HTML page.
2754  if (isset($this->config['config']['metaCharset']) && $this->config['config']['metaCharset'] !== 'utf-8') {
2755  $this->metaCharset = $this->config['config']['metaCharset'];
2756  }
2757 
2758  // Get values from site language
2759  if ($siteLanguage) {
2760  $languageAspect = ‪LanguageAspectFactory::createFromSiteLanguage($siteLanguage);
2761  } else {
2762  $languageAspect = ‪LanguageAspectFactory::createFromTypoScript($this->config['config'] ?? []);
2763  }
2764 
2765  $languageId = $languageAspect->getId();
2766  $languageContentId = $languageAspect->getContentId();
2767 
2768  // If sys_language_uid is set to another language than default:
2769  if ($languageAspect->getId() > 0) {
2770  // check whether a shortcut is overwritten by a translated page
2771  // we can only do this now, as this is the place where we get
2772  // to know about translations
2773  $this->‪checkTranslatedShortcut($languageAspect->getId());
2774  // Request the overlay record for the sys_language_uid:
2775  $olRec = $this->sys_page->getPageOverlay($this->id, $languageAspect->getId());
2776  if (empty($olRec)) {
2777  // If requested translation is not available:
2778  if (GeneralUtility::hideIfNotTranslated($this->page['l18n_cfg'])) {
2779  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
2780  ‪$GLOBALS['TYPO3_REQUEST'],
2781  'Page is not available in the requested language.',
2783  );
2784  throw new ImmediateResponseException($response, 1533931388);
2785  }
2786  switch ((string)$languageAspect->getLegacyLanguageMode()) {
2787  case 'strict':
2788  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
2789  ‪$GLOBALS['TYPO3_REQUEST'],
2790  'Page is not available in the requested language (strict).',
2792  );
2793  throw new ImmediateResponseException($response, 1533931395);
2794  break;
2795  case 'fallback':
2796  case 'content_fallback':
2797  // Setting content uid (but leaving the sys_language_uid) when a content_fallback
2798  // value was found.
2799  foreach ($languageAspect->getFallbackChain() ?? [] as $orderValue) {
2800  if ($orderValue === '0' || $orderValue === 0 || $orderValue === '') {
2801  $languageContentId = 0;
2802  break;
2803  }
2804  if (‪MathUtility::canBeInterpretedAsInteger($orderValue) && !empty($this->sys_page->getPageOverlay($this->id, (int)$orderValue))) {
2805  $languageContentId = (int)$orderValue;
2806  break;
2807  }
2808  if ($orderValue === 'pageNotFound') {
2809  // The existing fallbacks have not been found, but instead of continuing
2810  // page rendering with default language, a "page not found" message should be shown
2811  // instead.
2812  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
2813  ‪$GLOBALS['TYPO3_REQUEST'],
2814  'Page is not available in the requested language (fallbacks did not apply).',
2816  );
2817  throw new ‪ImmediateResponseException($response, 1533931402);
2818  }
2819  }
2820  break;
2821  case 'ignore':
2822  $languageContentId = $languageAspect->getId();
2823  break;
2824  default:
2825  // Default is that everything defaults to the default language...
2826  $languageId = ($languageContentId = 0);
2827  }
2828  }
2829 
2830  // Define the language aspect again now
2831  $languageAspect = GeneralUtility::makeInstance(
2832  LanguageAspect::class,
2833  $languageId,
2834  $languageContentId,
2835  $languageAspect->getOverlayType(),
2836  $languageAspect->getFallbackChain()
2837  );
2838 
2839  // Setting sys_language if an overlay record was found (which it is only if a language is used)
2840  // We'll do this every time since the language aspect might have changed now
2841  // Doing this ensures that page properties like the page title are returned in the correct language
2842  $this->page = $this->sys_page->getPageOverlay($this->page, $languageAspect->getContentId());
2843 
2844  // Update SYS_LASTCHANGED for localized page record
2845  $this->‪setRegisterValueForSysLastChanged($this->page);
2846  }
2847 
2848  // Set the language aspect
2849  $this->context->setAspect('language', $languageAspect);
2850 
2851  // Setting sys_language_uid inside sys-page by creating a new page repository
2852  $this->sys_page = GeneralUtility::makeInstance(PageRepository::class, $this->context);
2853  // If default language is not available:
2854  if ((!$languageAspect->getContentId() || !$languageAspect->getId())
2855  && GeneralUtility::hideIfDefaultLanguage($this->page['l18n_cfg'] ?? 0)
2856  ) {
2857  $message = 'Page is not available in default language.';
2858  $this->logger->error($message);
2859  $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
2860  ‪$GLOBALS['TYPO3_REQUEST'],
2861  $message,
2863  );
2864  throw new ‪ImmediateResponseException($response, 1533931423);
2865  }
2866 
2867  if ($languageAspect->getId() > 0) {
2869  }
2870 
2871  // Finding the ISO code for the currently selected language
2872  // fetched by the sys_language record when not fetching content from the default language
2873  if ($siteLanguage = $this->‪getCurrentSiteLanguage()) {
2874  $this->sys_language_isocode = $siteLanguage->getTwoLetterIsoCode();
2875  } elseif ($languageAspect->getContentId() > 0) {
2876  // using sys_language_content because the ISO code only (currently) affect content selection from FlexForms - which should follow "sys_language_content"
2877  // Set the fourth parameter to TRUE in the next two getRawRecord() calls to
2878  // avoid versioning overlay to be applied as it generates an SQL error
2879  $sys_language_row = $this->sys_page->getRawRecord('sys_language', $languageAspect->getContentId(), 'language_isocode,static_lang_isocode');
2880  if (is_array($sys_language_row) && !empty($sys_language_row['language_isocode'])) {
2881  $this->sys_language_isocode = $sys_language_row['language_isocode'];
2882  }
2883  // the DB value is overridden by TypoScript
2884  if (!empty($this->config['config']['sys_language_isocode'])) {
2885  $this->sys_language_isocode = $this->config['config']['sys_language_isocode'];
2886  }
2887  } else {
2888  // fallback to the TypoScript option when rendering with sys_language_uid=0
2889  // also: use "en" by default
2890  if (!empty($this->config['config']['sys_language_isocode_default'])) {
2891  $this->sys_language_isocode = $this->config['config']['sys_language_isocode_default'];
2892  } else {
2893  $this->sys_language_isocode = $languageKey !== 'default' ? $languageKey : 'en';
2894  }
2895  }
2896 
2897  $_params = [];
2898  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess'] ?? [] as $_funcRef) {
2899  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
2900  }
2901  }
2902 
2906  protected function ‪updateRootLinesWithTranslations()
2907  {
2908  try {
2909  $this->rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $this->id, $this->MP, $this->context)->get();
2910  } catch (RootLineException $e) {
2911  $this->rootLine = [];
2912  }
2913  $this->tmpl->updateRootlineData($this->rootLine);
2914  }
2915 
2919  public function ‪settingLocale()
2920  {
2921  // Setting locale
2922  $locale = $this->config['config']['locale_all'];
2923  $siteLanguage = $this->‪getCurrentSiteLanguage();
2924  if ($siteLanguage) {
2925  $locale = $siteLanguage->getLocale();
2926  }
2927  if ($locale) {
2928  $availableLocales = GeneralUtility::trimExplode(',', $locale, true);
2929  // If LC_NUMERIC is set e.g. to 'de_DE' PHP parses float values locale-aware resulting in strings with comma
2930  // as decimal point which causes problems with value conversions - so we set all locale types except LC_NUMERIC
2931  // @see https://bugs.php.net/bug.php?id=53711
2932  $locale = setlocale(LC_COLLATE, ...$availableLocales);
2933  if ($locale) {
2934  // As str_* methods are locale aware and turkish has no upper case I
2935  // Class autoloading and other checks depending on case changing break with turkish locale LC_CTYPE
2936  // @see http://bugs.php.net/bug.php?id=35050
2937  if (strpos($locale, 'tr') !== 0) {
2938  setlocale(LC_CTYPE, ...$availableLocales);
2939  }
2940  setlocale(LC_MONETARY, ...$availableLocales);
2941  setlocale(LC_TIME, ...$availableLocales);
2942  } else {
2943  $this->‪getTimeTracker()->‪setTSlogMessage('Locale "' . htmlspecialchars($locale) . '" not found.', 3);
2944  }
2945  }
2946  }
2947 
2955  protected function ‪checkTranslatedShortcut(int $languageId)
2956  {
2957  if (!is_null($this->originalShortcutPage)) {
2958  $originalShortcutPageOverlay = $this->sys_page->getPageOverlay($this->originalShortcutPage['uid'], $languageId);
2959  if (!empty($originalShortcutPageOverlay['shortcut']) && $originalShortcutPageOverlay['shortcut'] != $this->id) {
2960  // the translation of the original shortcut page has a different shortcut target!
2961  // set the correct page and id
2962  $shortcut = $this->sys_page->getPageShortcut($originalShortcutPageOverlay['shortcut'], $originalShortcutPageOverlay['shortcut_mode'], $originalShortcutPageOverlay['uid']);
2963  $this->id = ($this->contentPid = $shortcut['uid']);
2964  $this->page = $this->sys_page->getPage($this->id);
2965  // Fix various effects on things like menus f.e.
2966  $this->‪fetch_the_id();
2967  $this->tmpl->rootLine = array_reverse($this->rootLine);
2968  }
2969  }
2970  }
2971 
2977  public function ‪handleDataSubmission()
2978  {
2979  trigger_error('$TSFE->handleDataSubmission() will be removed in TYPO3 v10.0. Use a PSR-15 middleware. The hooks are still executed as PSR-15 middleware but will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
2980  // Hook for processing data submission to extensions
2981  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['checkDataSubmission'] ?? [] as $className) {
2982  $_procObj = GeneralUtility::makeInstance($className);
2983  $_procObj->checkDataSubmission($this);
2984  }
2985  }
2986 
2994  public function ‪initializeRedirectUrlHandlers($calledFromCore = false)
2995  {
2996  $urlHandlers = ‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlHandlers'] ?? false;
2997  if (!$urlHandlers) {
2998  if (!$calledFromCore) {
2999  trigger_error('$TSFE->initializeRedirectUrlHandlers() will be removed in TYPO3 v10.0. Do not call this method anymore and implement UrlHandlers by PSR-15 middlewares instead.', E_USER_DEPRECATED);
3000  }
3001  return;
3002  }
3003  trigger_error('The system has registered RedirectUrlHandlers via $TYPO3_CONF_VARS[SC_OPTIONS][urlProcessing][urlHandlers]. This functionality will be removed in TYPO3 v10.0. Ensure that extensions using this functionality switch to PSR-15 middlewares instead.', E_USER_DEPRECATED);
3004 
3005  foreach ($urlHandlers as $identifier => $configuration) {
3006  if (empty($configuration) || !is_array($configuration)) {
3007  throw new \RuntimeException('Missing configuration for URL handler "' . $identifier . '".', 1442052263);
3008  }
3009  if (!is_string($configuration['handler']) || empty($configuration['handler']) || !class_exists($configuration['handler']) || !is_subclass_of($configuration['handler'], UrlHandlerInterface::class)) {
3010  throw new \RuntimeException('The URL handler "' . $identifier . '" defines an invalid provider. Ensure the class exists and implements the "' . UrlHandlerInterface::class . '".', 1442052249);
3011  }
3012  }
3013 
3014  $orderedHandlers = GeneralUtility::makeInstance(DependencyOrderingService::class)->orderByDependencies($urlHandlers);
3015 
3016  foreach ($orderedHandlers as $configuration) {
3018  $urlHandler = GeneralUtility::makeInstance($configuration['handler']);
3019  if ($urlHandler->canHandleCurrentUrl()) {
3020  $this->activeUrlHandlers[] = $urlHandler;
3021  }
3022  }
3023  }
3024 
3036  public function ‪redirectToExternalUrl($calledFromCore = false)
3037  {
3038  if (!$calledFromCore) {
3039  trigger_error('$TSFE->redirectToExternalUrl() will be removed in TYPO3 v10.0. Do not call this method anymore and implement UrlHandlers by PSR-15 middlewares instead.', E_USER_DEPRECATED);
3040  }
3041  foreach ($this->activeUrlHandlers as $redirectHandler) {
3042  $response = $redirectHandler->handle();
3043  if ($response instanceof ResponseInterface) {
3044  return $response;
3045  }
3046  }
3047 
3048  if (!empty($this->activeUrlHandlers)) {
3049  throw new \RuntimeException('A URL handler is active but did not process the URL.', 1442305505);
3050  }
3051 
3052  return null;
3053  }
3054 
3059  protected function ‪setUrlIdToken()
3060  {
3061  if ($this->config['config']['ftu']) {
3062  $this->getMethodUrlIdToken = ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['get_url_id_token'];
3063  } else {
3064  $this->getMethodUrlIdToken = '';
3065  }
3066  }
3067 
3074  public function ‪calculateLinkVars(array $queryParams = null)
3075  {
3076  if ($queryParams === null) {
3077  trigger_error('Calling $TSFE->calculateLinkVars() without first argument will not be supported in TYPO3 v10.0. anymore, and needs to be an array.', E_USER_DEPRECATED);
3078  $queryParams = GeneralUtility::_GET();
3079  }
3080  $this->linkVars = '';
3081  if (empty($this->config['config']['linkVars'])) {
3082  return;
3083  }
3084 
3085  ‪$linkVars = $this->‪splitLinkVarsString((string)$this->config['config']['linkVars']);
3086 
3087  if (empty(‪$linkVars)) {
3088  return;
3089  }
3090  foreach (‪$linkVars as $linkVar) {
3091  $test = $value = '';
3092  if (preg_match('/^(.*)\\((.+)\\)$/', $linkVar, $match)) {
3093  $linkVar = trim($match[1]);
3094  $test = trim($match[2]);
3095  }
3096 
3097  $keys = explode('|', $linkVar);
3098  $numberOfLevels = count($keys);
3099  $rootKey = trim($keys[0]);
3100  if (!isset($queryParams[$rootKey])) {
3101  continue;
3102  }
3103  $value = $queryParams[$rootKey];
3104  for ($i = 1; $i < $numberOfLevels; $i++) {
3105  $currentKey = trim($keys[$i]);
3106  if (isset($value[$currentKey])) {
3107  $value = $value[$currentKey];
3108  } else {
3109  $value = false;
3110  break;
3111  }
3112  }
3113  if ($value !== false) {
3114  $parameterName = $keys[0];
3115  for ($i = 1; $i < $numberOfLevels; $i++) {
3116  $parameterName .= '[' . $keys[$i] . ']';
3117  }
3118  if (!is_array($value)) {
3119  $temp = rawurlencode($value);
3120  if ($test !== '' && !$this->‪isAllowedLinkVarValue($temp, $test)) {
3121  // Error: This value was not allowed for this key
3122  continue;
3123  }
3124  $value = '&' . $parameterName . '=' . $temp;
3125  } else {
3126  if ($test !== '' && $test !== 'array') {
3127  // Error: This key must not be an array!
3128  continue;
3129  }
3130  $value = ‪HttpUtility::buildQueryString([$parameterName => $value], '&');
3131  }
3132  $this->linkVars .= $value;
3133  }
3134  }
3135  }
3136 
3144  protected function ‪splitLinkVarsString(string $string): array
3145  {
3146  $tempCommaReplacementString = '###KASPER###';
3147 
3148  // replace every "," wrapped in "()" by a "unique" string
3149  $string = preg_replace_callback('/\‍((?>[^()]|(?R))*\‍)/', function ($result) use ($tempCommaReplacementString) {
3150  return str_replace(',', $tempCommaReplacementString, $result[0]);
3151  }, $string);
3152 
3153  $string = GeneralUtility::trimExplode(',', $string);
3154 
3155  // replace all "unique" strings back to ","
3156  return str_replace($tempCommaReplacementString, ',', $string);
3157  }
3158 
3167  protected function ‪isAllowedLinkVarValue(string $haystack, string $needle): bool
3168  {
3169  $isAllowed = false;
3170  // Integer
3171  if ($needle === 'int' || $needle === 'integer') {
3173  $isAllowed = true;
3174  }
3175  } elseif (preg_match('/^\\/.+\\/[imsxeADSUXu]*$/', $needle)) {
3176  // Regular expression, only "//" is allowed as delimiter
3177  if (@preg_match($needle, $haystack)) {
3178  $isAllowed = true;
3179  }
3180  } elseif (strstr($needle, '-')) {
3181  // Range
3183  $range = explode('-', $needle);
3184  if ($range[0] <= $haystack && $range[1] >= $haystack) {
3185  $isAllowed = true;
3186  }
3187  }
3188  } elseif (strstr($needle, '|')) {
3189  // List
3190  // Trim the input
3191  $haystack = str_replace(' ', '', $haystack);
3192  if (strstr('|' . $needle . '|', '|' . $haystack . '|')) {
3193  $isAllowed = true;
3194  }
3195  } elseif ((string)$needle === (string)$haystack) {
3196  // String comparison
3197  $isAllowed = true;
3198  }
3199  return $isAllowed;
3200  }
3201 
3211  public function ‪getRedirectUriForMountPoint(ServerRequestInterface $request): ?string
3212  {
3213  if (!empty($this->originalMountPointPage) && (int)$this->originalMountPointPage['doktype'] === ‪PageRepository::DOKTYPE_MOUNTPOINT) {
3214  return $this->‪getUriToCurrentPageForRedirect($request);
3215  }
3216 
3217  return null;
3218  }
3219 
3227  public function ‪checkPageForMountpointRedirect()
3228  {
3229  trigger_error('$TSFE->checkPageForMountpointRedirect() will be removed in TYPO3 v10.0, as this is now handled within a PSR-15 middleware.', E_USER_DEPRECATED);
3230  if (!empty($this->originalMountPointPage) && $this->originalMountPointPage['doktype'] == ‪PageRepository::DOKTYPE_MOUNTPOINT) {
3231  $this->‪redirectToCurrentPage();
3232  }
3233  }
3234 
3245  public function ‪getRedirectUriForShortcut(ServerRequestInterface $request): ?string
3246  {
3247  if (!empty($this->originalShortcutPage) && $this->originalShortcutPage['doktype'] == ‪PageRepository::DOKTYPE_SHORTCUT) {
3248  return $this->‪getUriToCurrentPageForRedirect($request);
3249  }
3250 
3251  return null;
3252  }
3253 
3261  public function ‪checkPageForShortcutRedirect()
3262  {
3263  trigger_error('$TSFE->checkPageForShortcutRedirect() will be removed in TYPO3 v10.0, as this is now done within a PSR-15 middleware.', E_USER_DEPRECATED);
3264  if (!empty($this->originalShortcutPage) && (int)$this->originalShortcutPage['doktype'] === ‪PageRepository::DOKTYPE_SHORTCUT) {
3265  $this->‪redirectToCurrentPage();
3266  }
3267  }
3268 
3274  protected function ‪redirectToCurrentPage()
3275  {
3276  trigger_error('$TSFE->redirectToCurrentPage() will be removed in TYPO3 v10.0, as this is now done within a PSR-15 middleware.', E_USER_DEPRECATED);
3277  $redirectUrl = $this->‪getUriToCurrentPageForRedirect($GLOBALS['TYPO3_REQUEST']);
3278  // Prevent redirection loop
3279  if (!empty($redirectUrl) && GeneralUtility::getIndpEnv('REQUEST_URI') !== '/' . $redirectUrl) {
3280  // redirect and exit
3282  }
3283  }
3284 
3291  protected function ‪getUriToCurrentPageForRedirect(ServerRequestInterface $request): string
3292  {
3293  $this->‪calculateLinkVars($request->getQueryParams());
3294  $parameter = $this->page['uid'];
3295  if ($this->type && ‪MathUtility::canBeInterpretedAsInteger($this->type)) {
3296  $parameter .= ',' . ‪$this->type;
3297  }
3298  return GeneralUtility::makeInstance(ContentObjectRenderer::class, $this)->typoLink_URL([
3299  'parameter' => $parameter,
3300  'addQueryString' => true,
3301  'addQueryString.' => ['exclude' => 'id'],
3302  // ensure absolute URL is generated when having a valid Site
3303  'forceAbsoluteUrl' => ‪$GLOBALS['TYPO3_REQUEST'] instanceof ServerRequestInterface
3304  && ‪$GLOBALS['TYPO3_REQUEST']->getAttribute('site') instanceof ‪Site
3305  ]);
3306  }
3307 
3308  /********************************************
3309  *
3310  * Page generation; cache handling
3311  *
3312  *******************************************/
3319  public function ‪isGeneratePage()
3320  {
3321  return !$this->cacheContentFlag && empty($this->activeUrlHandlers);
3322  }
3323 
3327  protected function ‪realPageCacheContent()
3328  {
3329  // seconds until a cached page is too old
3330  $cacheTimeout = $this->‪get_cache_timeout();
3331  $timeOutTime = ‪$GLOBALS['EXEC_TIME'] + $cacheTimeout;
3332  $usePageCache = true;
3333  // Hook for deciding whether page cache should be written to the cache backend or not
3334  // NOTE: as hooks are called in a loop, the last hook will have the final word (however each
3335  // hook receives the current status of the $usePageCache flag)
3336  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['usePageCache'] ?? [] as $className) {
3337  $usePageCache = GeneralUtility::makeInstance($className)->usePageCache($this, $usePageCache);
3338  }
3339  // Write the page to cache, if necessary
3340  if ($usePageCache) {
3341  $this->‪setPageCacheContent($this->content, $this->config, $timeOutTime);
3342  }
3343  // Hook for cache post processing (eg. writing static files!)
3344  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['insertPageIncache'] ?? [] as $className) {
3345  GeneralUtility::makeInstance($className)->insertPageIncache($this, $timeOutTime);
3346  }
3347  }
3348 
3357  protected function ‪setPageCacheContent(‪$content, $data, $expirationTstamp)
3358  {
3359  $cacheData = [
3360  'identifier' => ‪$this->newHash,
3361  'page_id' => ‪$this->id,
3362  'content' => ‪$content,
3363  'cache_data' => $data,
3364  'expires' => $expirationTstamp,
3365  'tstamp' => ‪$GLOBALS['EXEC_TIME'],
3366  'pageTitleInfo' => [
3367  'title' => $this->page['title'],
3368  'altPageTitle' => ‪$this->altPageTitle,
3369  'indexedDocTitle' => ‪$this->indexedDocTitle
3370  ]
3371  ];
3372  $this->cacheExpires = $expirationTstamp;
3373  $this->pageCacheTags[] = 'pageId_' . $cacheData['page_id'];
3374  // Respect the page cache when content of pid is shown
3375  if ($this->id !== $this->contentPid) {
3376  $this->pageCacheTags[] = 'pageId_' . ‪$this->contentPid;
3377  }
3378  if ($this->page_cache_reg1) {
3379  // @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. Remove this "if" along with property page_cache_reg1
3380  trigger_error('$TSFE->page_cache_reg1 will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
3381  $reg1 = (int)$this->page_cache_reg1;
3382  $cacheData['reg1'] = $reg1;
3383  $this->pageCacheTags[] = 'reg1_' . $reg1;
3384  }
3385  if (!empty($this->page['cache_tags'])) {
3386  $tags = GeneralUtility::trimExplode(',', $this->page['cache_tags'], true);
3387  $this->pageCacheTags = array_merge($this->pageCacheTags, $tags);
3388  }
3389  // Add the cache themselves as well, because they are fetched by getPageCacheTags()
3390  $cacheData['cacheTags'] = ‪$this->pageCacheTags;
3391  $this->pageCache->set($this->newHash, $cacheData, $this->pageCacheTags, $expirationTstamp - ‪$GLOBALS['EXEC_TIME']);
3392  }
3393 
3397  public function ‪clearPageCacheContent()
3398  {
3399  $this->pageCache->remove($this->newHash);
3400  }
3401 
3407  protected function ‪clearPageCacheContent_pidList($pidList)
3408  {
3409  $pageIds = GeneralUtility::trimExplode(',', $pidList);
3410  foreach ($pageIds as $pageId) {
3411  $this->pageCache->flushByTag('pageId_' . (int)$pageId);
3412  }
3413  }
3414 
3421  protected function ‪setSysLastChanged()
3422  {
3423  // We only update the info if browsing the live workspace
3424  if ($this->page['SYS_LASTCHANGED'] < (int)$this->register['SYS_LASTCHANGED'] && !$this->‪doWorkspacePreview()) {
3425  $connection = GeneralUtility::makeInstance(ConnectionPool::class)
3426  ->getConnectionForTable('pages');
3427  $pageId = $this->page['_PAGES_OVERLAY_UID'] ?? ‪$this->id;
3428  $connection->update(
3429  'pages',
3430  [
3431  'SYS_LASTCHANGED' => (int)$this->register['SYS_LASTCHANGED']
3432  ],
3433  [
3434  'uid' => (int)$pageId
3435  ]
3436  );
3437  }
3438  }
3439 
3447  protected function ‪setRegisterValueForSysLastChanged(array ‪$page): void
3448  {
3449  $this->register['SYS_LASTCHANGED'] = (int)‪$page['tstamp'];
3450  if ($this->register['SYS_LASTCHANGED'] < (int)$page['SYS_LASTCHANGED']) {
3451  $this->register['SYS_LASTCHANGED'] = (int)‪$page['SYS_LASTCHANGED'];
3452  }
3453  }
3454 
3460  public function ‪releaseLocks()
3461  {
3462  $this->‪releaseLock('pagesection');
3463  $this->‪releaseLock('pages');
3464  }
3465 
3472  public function ‪addCacheTags(array $tags)
3473  {
3474  $this->pageCacheTags = array_merge($this->pageCacheTags, $tags);
3475  }
3476 
3480  public function ‪getPageCacheTags(): array
3481  {
3482  return ‪$this->pageCacheTags;
3483  }
3484 
3485  /********************************************
3486  *
3487  * Page generation; rendering and inclusion
3488  *
3489  *******************************************/
3493  public function ‪generatePage_preProcessing()
3494  {
3495  // Same codeline as in getFromCache(). But $this->all has been changed by
3496  // \TYPO3\CMS\Core\TypoScript\TemplateService::start() in the meantime, so this must be called again!
3497  $this->newHash = $this->‪getHash();
3498 
3499  // Setting cache_timeout_default. May be overridden by PHP include scripts.
3500  $this->cacheTimeOutDefault = (int)($this->config['config']['cache_period'] ?? 0);
3501  // Page is generated
3502  $this->no_cacheBeforePageGen = ‪$this->no_cache;
3503  }
3504 
3511  public function ‪preparePageContentGeneration(ServerRequestInterface $request = null)
3512  {
3513  if ($request === null) {
3514  trigger_error('$TSFE->preparePageContentGeneration() requires a ServerRequestInterface as first argument, add this argument in order to avoid this deprecation error.', E_USER_DEPRECATED);
3516  }
3517  $this->‪getTimeTracker()->‪push('Prepare page content generation');
3518  if (isset($this->page['content_from_pid']) && $this->page['content_from_pid'] > 0) {
3519  // make REAL copy of TSFE object - not reference!
3520  $temp_copy_TSFE = clone $this;
3521  // Set ->id to the content_from_pid value - we are going to evaluate this pid as was it a given id for a page-display!
3522  $temp_copy_TSFE->id = $this->page['content_from_pid'];
3523  $temp_copy_TSFE->MP = '';
3524  $temp_copy_TSFE->getPageAndRootlineWithDomain($this->config['config']['content_from_pid_allowOutsideDomain'] ? 0 : $this->domainStartPage);
3525  $this->contentPid = (int)$temp_copy_TSFE->id;
3526  unset($temp_copy_TSFE);
3527  }
3528  if ($this->config['config']['MP_defaults'] ?? false) {
3529  $temp_parts = GeneralUtility::trimExplode('|', $this->config['config']['MP_defaults'], true);
3530  foreach ($temp_parts as $temp_p) {
3531  list($temp_idP, $temp_MPp) = explode(':', $temp_p, 2);
3532  $temp_ids = GeneralUtility::intExplode(',', $temp_idP);
3533  foreach ($temp_ids as $temp_id) {
3534  $this->MP_defaults[$temp_id] = $temp_MPp;
3535  }
3536  }
3537  }
3538  // Global vars...
3539  $this->indexedDocTitle = $this->page['title'] ?? null;
3540  $this->‪debug = !empty($this->config['config']['debug']);
3541  // Base url:
3542  if (isset($this->config['config']['baseURL'])) {
3543  $this->baseUrl = $this->config['config']['baseURL'];
3544  }
3545  // Internal and External target defaults
3546  $this->intTarget = (string)($this->config['config']['intTarget'] ?? '');
3547  $this->extTarget = (string)($this->config['config']['extTarget'] ?? '');
3548  $this->fileTarget = (string)($this->config['config']['fileTarget'] ?? '');
3549  $this->spamProtectEmailAddresses = $this->config['config']['spamProtectEmailAddresses'] ?? 0;
3550  if ($this->spamProtectEmailAddresses !== 'ascii') {
3551  $this->spamProtectEmailAddresses = ‪MathUtility::forceIntegerInRange($this->spamProtectEmailAddresses, -10, 10, 0);
3552  }
3553  // calculate the absolute path prefix
3554  if (!empty($this->config['config']['absRefPrefix'])) {
3555  ‪$absRefPrefix = trim($this->config['config']['absRefPrefix']);
3556  if (‪$absRefPrefix === 'auto') {
3557  $this->absRefPrefix = GeneralUtility::getIndpEnv('TYPO3_SITE_PATH');
3558  } else {
3559  $this->absRefPrefix = ‪$absRefPrefix;
3560  }
3561  } else {
3562  $this->absRefPrefix = '';
3563  }
3564  $this->ATagParams = trim($this->config['config']['ATagParams'] ?? '') ? ' ' . trim($this->config['config']['ATagParams']) : '';
3565  $this->‪initializeSearchWordData($request->getParsedBody()['sword_list'] ?? $request->getQueryParams()['sword_list'] ?? null);
3566  // linkVars
3567  $this->‪calculateLinkVars($request->getQueryParams());
3568  // Setting XHTML-doctype from doctype
3569  if (!isset($this->config['config']['xhtmlDoctype']) || !$this->config['config']['xhtmlDoctype']) {
3570  $this->config['config']['xhtmlDoctype'] = $this->config['config']['doctype'] ?? '';
3571  }
3572  if ($this->config['config']['xhtmlDoctype']) {
3573  $this->xhtmlDoctype = $this->config['config']['xhtmlDoctype'];
3574  // Checking XHTML-docytpe
3575  switch ((string)$this->config['config']['xhtmlDoctype']) {
3576  case 'xhtml_trans':
3577  case 'xhtml_strict':
3578  $this->xhtmlVersion = 100;
3579  break;
3580  case 'xhtml_basic':
3581  $this->xhtmlVersion = 105;
3582  break;
3583  case 'xhtml_11':
3584  case 'xhtml+rdfa_10':
3585  $this->xhtmlVersion = 110;
3586  break;
3587  default:
3588  $this->pageRenderer->setRenderXhtml(false);
3589  $this->xhtmlDoctype = '';
3590  $this->xhtmlVersion = 0;
3591  }
3592  } else {
3593  $this->pageRenderer->setRenderXhtml(false);
3594  }
3595 
3596  // Global content object
3597  $this->‪newCObj();
3598  $this->‪getTimeTracker()->‪pull();
3599  }
3600 
3609  protected function ‪initializeSearchWordData($searchWords)
3610  {
3611  $this->sWordRegEx = '';
3612  $this->sWordList = $searchWords === null ? '' : $searchWords;
3613  if (is_array($this->sWordList)) {
3614  $space = !empty($this->config['config']['sword_standAlone'] ?? null) ? '[[:space:]]' : '';
3615  $regexpParts = [];
3616  foreach ($this->sWordList as $val) {
3617  if (trim($val) !== '') {
3618  $regexpParts[] = $space . preg_quote($val, '/') . $space;
3619  }
3620  }
3621  $this->sWordRegEx = implode('|', $regexpParts);
3622  }
3623  }
3624 
3629  public function ‪generatePage_postProcessing()
3630  {
3631  // This is to ensure, that the page is NOT cached if the no_cache parameter was set before the page was generated. This is a safety precaution, as it could have been unset by some script.
3632  if ($this->no_cacheBeforePageGen) {
3633  $this->‪set_no_cache('no_cache has been set before the page was generated - safety check', true);
3634  }
3635  // Hook for post-processing of page content cached/non-cached:
3636  $_params = ['pObj' => &$this];
3637  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'] ?? [] as $_funcRef) {
3638  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
3639  }
3640  // Processing if caching is enabled:
3641  if (!$this->no_cache) {
3642  // Hook for post-processing of page content before being cached:
3643  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-cached'] ?? [] as $_funcRef) {
3644  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
3645  }
3646  }
3647  // Convert char-set for output: (should be BEFORE indexing of the content (changed 22/4 2005)),
3648  // because otherwise indexed search might convert from the wrong charset!
3649  // One thing is that the charset mentioned in the HTML header would be wrong since the output charset (metaCharset)
3650  // has not been converted to from utf-8. And indexed search will internally convert from metaCharset
3651  // to utf-8 so the content MUST be in metaCharset already!
3652  $this->content = $this->‪convOutputCharset($this->content);
3653  // Hook for indexing pages
3654  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['pageIndexing'] ?? [] as $className) {
3655  GeneralUtility::makeInstance($className)->hook_indexContent($this);
3656  }
3657  // Storing for cache:
3658  if (!$this->no_cache) {
3660  }
3661  // Sets sys-last-change:
3662  $this->‪setSysLastChanged();
3663  }
3664 
3671  public function ‪generatePageTitle(): string
3672  {
3673  $pageTitleSeparator = '';
3674 
3675  // Check for a custom pageTitleSeparator, and perform stdWrap on it
3676  if (isset($this->config['config']['pageTitleSeparator']) && $this->config['config']['pageTitleSeparator'] !== '') {
3677  $pageTitleSeparator = $this->config['config']['pageTitleSeparator'];
3678 
3679  if (isset($this->config['config']['pageTitleSeparator.']) && is_array($this->config['config']['pageTitleSeparator.'])) {
3680  $pageTitleSeparator = $this->cObj->stdWrap($pageTitleSeparator, $this->config['config']['pageTitleSeparator.']);
3681  } else {
3682  $pageTitleSeparator .= ' ';
3683  }
3684  }
3685 
3686  $titleProvider = GeneralUtility::makeInstance(PageTitleProviderManager::class);
3687  if (!empty($this->config['config']['pageTitleCache'])) {
3688  $titleProvider->setPageTitleCache($this->config['config']['pageTitleCache']);
3689  }
3690  $pageTitle = $titleProvider->getTitle();
3691  $this->config['config']['pageTitleCache'] = $titleProvider->getPageTitleCache();
3692 
3693  if ($pageTitle !== '') {
3694  $this->indexedDocTitle = $pageTitle;
3695  }
3696 
3697  $titleTagContent = $this->‪printTitle(
3698  $pageTitle,
3699  (bool)($this->config['config']['noPageTitle'] ?? false),
3700  (bool)($this->config['config']['pageTitleFirst'] ?? false),
3701  $pageTitleSeparator
3702  );
3703  if ($this->config['config']['titleTagFunction'] ?? false) {
3704  // @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0
3705  $this->‪logDeprecatedTyposcript('config.titleTagFunction', 'Please use the new TitleTag API to create custom title tags. Deprecated in version 9, will be removed in version 10');
3706 
3707  $titleTagContent = $this->cObj->callUserFunction(
3708  $this->config['config']['titleTagFunction'],
3709  [],
3710  $titleTagContent
3711  );
3712  }
3713  // stdWrap around the title tag
3714  if (isset($this->config['config']['pageTitle.']) && is_array($this->config['config']['pageTitle.'])) {
3715  $titleTagContent = $this->cObj->stdWrap($titleTagContent, $this->config['config']['pageTitle.']);
3716  }
3717 
3718  // config.noPageTitle = 2 - means do not render the page title
3719  if (isset($this->config['config']['noPageTitle']) && (int)$this->config['config']['noPageTitle'] === 2) {
3720  $titleTagContent = '';
3721  }
3722  if ($titleTagContent !== '') {
3723  $this->pageRenderer->setTitle($titleTagContent);
3724  }
3725  return (string)$titleTagContent;
3726  }
3727 
3738  protected function ‪printTitle(string $pageTitle, bool $noTitle = false, bool $showTitleFirst = false, string $pageTitleSeparator = ''): string
3739  {
3740  $siteTitle = trim($this->tmpl->setup['sitetitle'] ?? '');
3741  $pageTitle = $noTitle ? '' : $pageTitle;
3742  if ($showTitleFirst) {
3743  $temp = $siteTitle;
3744  $siteTitle = $pageTitle;
3745  $pageTitle = $temp;
3746  }
3747  // only show a separator if there are both site title and page title
3748  if ($pageTitle === '' || $siteTitle === '') {
3749  $pageTitleSeparator = '';
3750  } elseif (empty($pageTitleSeparator)) {
3751  // use the default separator if non given
3752  $pageTitleSeparator = ': ';
3753  }
3754  return $siteTitle . $pageTitleSeparator . $pageTitle;
3755  }
3756 
3760  public function ‪INTincScript()
3761  {
3762  // Deprecated stuff:
3763  // @deprecated: annotation added TYPO3 4.6
3764  $this->additionalHeaderData = (isset($this->config['INTincScript_ext']['additionalHeaderData']) && is_array($this->config['INTincScript_ext']['additionalHeaderData']))
3765  ? $this->config['INTincScript_ext']['additionalHeaderData']
3766  : [];
3767  $this->additionalFooterData = (isset($this->config['INTincScript_ext']['additionalFooterData']) && is_array($this->config['INTincScript_ext']['additionalFooterData']))
3768  ? $this->config['INTincScript_ext']['additionalFooterData']
3769  : [];
3770  $this->additionalJavaScript = $this->config['INTincScript_ext']['additionalJavaScript'] ?? null;
3771  $this->additionalCSS = $this->config['INTincScript_ext']['additionalCSS'] ?? null;
3772  $this->divSection = '';
3773  if (empty($this->config['INTincScript_ext']['pageRenderer'])) {
3775  } else {
3777  ‪$pageRenderer = unserialize($this->config['INTincScript_ext']['pageRenderer']);
3778  $this->pageRenderer = ‪$pageRenderer;
3779  GeneralUtility::setSingletonInstance(PageRenderer::class, ‪$pageRenderer);
3780  }
3781 
3783  $this->‪getTimeTracker()->‪push('Substitute header section');
3784  $this->‪INTincScript_loadJSCode();
3785  $this->‪generatePageTitle();
3786 
3787  $this->content = str_replace(
3788  [
3789  '<!--HD_' . $this->config['INTincScript_ext']['divKey'] . '-->',
3790  '<!--FD_' . $this->config['INTincScript_ext']['divKey'] . '-->',
3791  '<!--TDS_' . $this->config['INTincScript_ext']['divKey'] . '-->'
3792  ],
3793  [
3794  $this->‪convOutputCharset(implode(LF, $this->additionalHeaderData)),
3795  $this->‪convOutputCharset(implode(LF, $this->additionalFooterData)),
3796  $this->‪convOutputCharset($this->divSection),
3797  ],
3798  $this->pageRenderer->renderJavaScriptAndCssForProcessingOfUncachedContentObjects($this->content, $this->config['INTincScript_ext']['divKey'])
3799  );
3800  // Replace again, because header and footer data and page renderer replacements may introduce additional placeholders (see #44825)
3802  $this->‪setAbsRefPrefix();
3803  $this->‪getTimeTracker()->‪pull();
3804  }
3805 
3812  {
3813  do {
3814  $INTiS_config = $this->config['INTincScript'];
3815  $this->‪INTincScript_process($INTiS_config);
3816  // Check if there were new items added to INTincScript during the previous execution:
3817  // array_diff_assoc throws notices if values are arrays but not strings. We suppress this here.
3818  $INTiS_config = @array_diff_assoc($this->config['INTincScript'], $INTiS_config);
3819  $reprocess = count($INTiS_config) > 0;
3820  } while ($reprocess);
3821  }
3822 
3829  protected function ‪INTincScript_process($INTiS_config)
3830  {
3831  $timeTracker = $this->‪getTimeTracker();
3832  $timeTracker->push('Split content');
3833  // Splits content with the key.
3834  $INTiS_splitC = explode('<!--INT_SCRIPT.', $this->content);
3835  $this->content = '';
3836  $timeTracker->setTSlogMessage('Parts: ' . count($INTiS_splitC));
3837  $timeTracker->pull();
3838  foreach ($INTiS_splitC as $INTiS_c => $INTiS_cPart) {
3839  // If the split had a comment-end after 32 characters it's probably a split-string
3840  if (substr($INTiS_cPart, 32, 3) === '-->') {
3841  $INTiS_key = 'INT_SCRIPT.' . substr($INTiS_cPart, 0, 32);
3842  if (is_array($INTiS_config[$INTiS_key])) {
3843  $label = 'Include ' . $INTiS_config[$INTiS_key]['type'];
3844  $label = $label . isset($INTiS_config[$INTiS_key]['file']) ? ' ' . $INTiS_config[$INTiS_key]['file'] : '';
3845  $timeTracker->push($label);
3846  $incContent = '';
3847  $INTiS_cObj = unserialize($INTiS_config[$INTiS_key]['cObj']);
3848  /* @var ContentObjectRenderer $INTiS_cObj */
3849  switch ($INTiS_config[$INTiS_key]['type']) {
3850  case 'COA':
3851  $incContent = $INTiS_cObj->cObjGetSingle('COA', $INTiS_config[$INTiS_key]['conf']);
3852  break;
3853  case 'FUNC':
3854  $incContent = $INTiS_cObj->cObjGetSingle('USER', $INTiS_config[$INTiS_key]['conf']);
3855  break;
3856  case 'POSTUSERFUNC':
3857  $incContent = $INTiS_cObj->callUserFunction($INTiS_config[$INTiS_key]['postUserFunc'], $INTiS_config[$INTiS_key]['conf'], $INTiS_config[$INTiS_key]['content']);
3858  break;
3859  }
3860  $this->content .= $this->‪convOutputCharset($incContent);
3861  $this->content .= substr($INTiS_cPart, 35);
3862  $timeTracker->pull($incContent);
3863  } else {
3864  $this->content .= substr($INTiS_cPart, 35);
3865  }
3866  } else {
3867  $this->content .= ($INTiS_c ? '<!--INT_SCRIPT.' : '') . $INTiS_cPart;
3868  }
3869  }
3870  }
3871 
3875  public function ‪INTincScript_loadJSCode()
3876  {
3877  // Add javascript
3878  $jsCode = trim($this->JSCode);
3879  ‪$additionalJavaScript = is_array($this->additionalJavaScript)
3880  ? implode(LF, $this->additionalJavaScript)
3881  : $this->additionalJavaScript;
3883  if ($jsCode !== '' || ‪$additionalJavaScript !== '') {
3884  $this->additionalHeaderData['JSCode'] = '
3885 <script type="text/javascript">
3886  /*<![CDATA[*/
3887 <!--
3889 ' . $jsCode . '
3890 // -->
3891  /*]]>*/
3892 </script>';
3893  }
3894  // Add CSS
3895  $additionalCss = is_array($this->additionalCSS) ? implode(LF, $this->additionalCSS) : $this->additionalCSS;
3896  $additionalCss = trim($additionalCss);
3897  if ($additionalCss !== '') {
3898  $this->additionalHeaderData['_CSS'] = '
3899 <style type="text/css">
3900 ' . $additionalCss . '
3901 </style>';
3902  }
3903  }
3904 
3910  public function ‪isINTincScript()
3911  {
3912  return is_array($this->config['INTincScript']) && empty($this->activeUrlHandlers);
3913  }
3915  /********************************************
3916  *
3917  * Finished off; outputting, storing session data, statistics...
3918  *
3919  *******************************************/
3926  public function ‪isOutputting()
3927  {
3928  // Initialize by status if there is a Redirect URL
3929  $enableOutput = empty($this->activeUrlHandlers);
3930  // Call hook for possible disabling of output:
3931  $_params = ['pObj' => &$this, 'enableOutput' => &$enableOutput];
3932  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['isOutputting'] ?? [] as $_funcRef) {
3933  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
3934  }
3935  return $enableOutput;
3936  }
3937 
3947  public function ‪processOutput()
3948  {
3949  trigger_error('TypoScriptFrontendController->processOutput() will be removed in TYPO3 v10.0. Use streamFile() instead.', E_USER_DEPRECATED);
3950  $this->‪sendHttpHeadersDirectly();
3951  $this->‪processContentForOutput();
3952  }
3953 
3959  public function ‪sendHttpHeadersDirectly()
3960  {
3961  // Set header for charset-encoding unless disabled
3962  if (empty($this->config['config']['disableCharsetHeader'])) {
3963  $headLine = 'Content-Type: ' . $this->contentType . '; charset=' . trim($this->metaCharset);
3964  header($headLine);
3965  }
3966  // Set header for content language unless disabled
3967  if (empty($this->config['config']['disableLanguageHeader']) && !empty($this->sys_language_isocode)) {
3968  $headLine = 'Content-Language: ' . trim($this->sys_language_isocode);
3969  header($headLine);
3970  }
3971  // Set cache related headers to client (used to enable proxy / client caching!)
3972  if (!empty($this->config['config']['sendCacheHeaders'])) {
3973  $headers = $this->‪getCacheHeaders();
3974  foreach ($headers as $header => $value) {
3975  header($header . ': ' . $value);
3976  }
3977  }
3978  // Set additional headers if any have been configured via TypoScript
3979  $additionalHeaders = $this->‪getAdditionalHeaders();
3980  foreach ($additionalHeaders as $headerConfig) {
3981  header(
3982  $headerConfig['header'],
3983  // "replace existing headers" is turned on by default, unless turned off
3984  $headerConfig['replace'],
3985  $headerConfig['statusCode']
3986  );
3987  }
3988  }
3989 
3996  public function ‪processContentForOutput()
3997  {
3998  // Make substitution of eg. username/uid in content only if cache-headers for client/proxy caching is NOT sent!
3999  if (!$this->isClientCachable) {
4000  $this->‪contentStrReplace();
4001  }
4002  // Hook for post-processing of page content before output:
4003  $_params = ['pObj' => &$this];
4004  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-output'] ?? [] as $_funcRef) {
4005  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
4006  }
4007  }
4008 
4015  public function ‪applyHttpHeadersToResponse(ResponseInterface $response): ResponseInterface
4016  {
4017  // Set header for charset-encoding unless disabled
4018  if (empty($this->config['config']['disableCharsetHeader'])) {
4019  $response = $response->withHeader('Content-Type', $this->contentType . '; charset=' . trim($this->metaCharset));
4020  }
4021  // Set header for content language unless disabled
4022  if (empty($this->config['config']['disableLanguageHeader']) && !empty($this->sys_language_isocode)) {
4023  $response = $response->withHeader('Content-Language', trim($this->sys_language_isocode));
4024  }
4025  // Set cache related headers to client (used to enable proxy / client caching!)
4026  if (!empty($this->config['config']['sendCacheHeaders'])) {
4027  $headers = $this->‪getCacheHeaders();
4028  foreach ($headers as $header => $value) {
4029  $response = $response->withHeader($header, $value);
4030  }
4031  }
4032  // Set additional headers if any have been configured via TypoScript
4033  $additionalHeaders = $this->‪getAdditionalHeaders();
4034  foreach ($additionalHeaders as $headerConfig) {
4035  list($header, $value) = GeneralUtility::trimExplode(':', $headerConfig['header'], false, 2);
4036  if ($headerConfig['statusCode']) {
4037  $response = $response->withStatus((int)$headerConfig['statusCode']);
4038  }
4039  if ($headerConfig['replace']) {
4040  $response = $response->withHeader($header, $value);
4041  } else {
4042  $response = $response->withAddedHeader($header, $value);
4043  }
4044  }
4045  return $response;
4046  }
4047 
4053  public function ‪sendCacheHeaders()
4054  {
4055  trigger_error('$TSFE->sendCacheHeaders() will be removed in TYPO3 v10.0, as all headers are compiled within "processOutput" depending on various scenarios. Use $TSFE->processOutput() instead.', E_USER_DEPRECATED);
4056  $headers = $this->‪getCacheHeaders();
4057  foreach ($headers as $header => $value) {
4058  header($header . ': ' . $value);
4059  }
4060  }
4061 
4067  protected function ‪getCacheHeaders(): array
4068  {
4069  // Getting status whether we can send cache control headers for proxy caching:
4070  $doCache = $this->‪isStaticCacheble();
4071  // This variable will be TRUE unless cache headers are configured to be sent ONLY if a branch does not allow logins and logins turns out to be allowed anyway...
4072  $loginsDeniedCfg = empty($this->config['config']['sendCacheHeaders_onlyWhenLoginDeniedInBranch']) || empty($this->loginAllowedInBranch);
4073  // Finally, when backend users are logged in, do not send cache headers at all (Admin Panel might be displayed for instance).
4074  $this->isClientCachable = $doCache && !$this->‪isBackendUserLoggedIn() && !$this->‪doWorkspacePreview() && $loginsDeniedCfg;
4075  if ($this->isClientCachable) {
4076  $headers = [
4077  'Expires' => gmdate('D, d M Y H:i:s T', $this->cacheExpires),
4078  'ETag' => '"' . md5($this->content) . '"',
4079  'Cache-Control' => 'max-age=' . ($this->cacheExpires - ‪$GLOBALS['EXEC_TIME']),
4080  // no-cache
4081  'Pragma' => 'public'
4082  ];
4083  } else {
4084  // "no-store" is used to ensure that the client HAS to ask the server every time, and is not allowed to store anything at all
4085  $headers = [
4086  'Cache-Control' => 'private, no-store'
4087  ];
4088  // Now, if a backend user is logged in, tell him in the Admin Panel log what the caching status would have been:
4089  if ($this->‪isBackendUserLoggedIn()) {
4090  if ($doCache) {
4091  $this->‪getTimeTracker()->‪setTSlogMessage('Cache-headers with max-age "' . ($this->cacheExpires - ‪$GLOBALS['EXEC_TIME']) . '" would have been sent');
4092  } else {
4093  $reasonMsg = [];
4094  if ($this->no_cache) {
4095  $reasonMsg[] = 'Caching disabled (no_cache).';
4096  }
4097  if ($this->‪isINTincScript()) {
4098  $reasonMsg[] = '*_INT object(s) on page.';
4099  }
4100  if (is_array($this->fe_user->user)) {
4101  $reasonMsg[] = 'Frontend user logged in.';
4102  }
4103  $this->‪getTimeTracker()->‪setTSlogMessage('Cache-headers would disable proxy caching! Reason(s): "' . implode(' ', $reasonMsg) . '"', 1);
4104  }
4105  }
4106  }
4107  return $headers;
4108  }
4109 
4120  public function ‪isStaticCacheble()
4121  {
4122  $doCache = !$this->no_cache && !$this->‪isINTincScript() && !$this->‪isUserOrGroupSet();
4123  return $doCache;
4124  }
4125 
4129  protected function ‪contentStrReplace()
4130  {
4131  $search = [];
4132  $replace = [];
4133  // Substitutes username mark with the username
4134  if (!empty($this->fe_user->user['uid'])) {
4135  // User name:
4136  $token = isset($this->config['config']['USERNAME_substToken']) ? trim($this->config['config']['USERNAME_substToken']) : '';
4137  $search[] = $token ? $token : '<!--###USERNAME###-->';
4138  $replace[] = htmlspecialchars($this->fe_user->user['username']);
4139  // User uid (if configured):
4140  $token = isset($this->config['config']['USERUID_substToken']) ? trim($this->config['config']['USERUID_substToken']) : '';
4141  if ($token) {
4142  $search[] = $token;
4143  $replace[] = $this->fe_user->user['uid'];
4144  }
4145  }
4146  // Substitutes get_URL_ID in case of GET-fallback
4147  if ($this->getMethodUrlIdToken) {
4148  $search[] = ‪$this->getMethodUrlIdToken;
4149  $replace[] = $this->fe_user->get_URL_ID;
4150  }
4151  // Hook for supplying custom search/replace data
4152  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-contentStrReplace'] ?? [] as $_funcRef) {
4153  $_params = [
4154  'search' => &$search,
4155  'replace' => &$replace
4156  ];
4157  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
4158  }
4159  if (!empty($search)) {
4160  $this->content = str_replace($search, $replace, $this->content);
4161  }
4162  }
4163 
4169  public function ‪storeSessionData()
4170  {
4171  trigger_error('$TSFE->storeSessionData() will be removed in TYPO3 v10.0. Use the call on the FrontendUserAuthentication object directly instead.', E_USER_DEPRECATED);
4172  $this->fe_user->storeSessionData();
4173  }
4174 
4181  public function ‪previewInfo($isCoreCall = false)
4182  {
4183  if (!$isCoreCall) {
4184  trigger_error('$TSFE->previewInfo() will be removed in TYPO3 v10.0, as this is now called by the Frontend RequestHandler.', E_USER_DEPRECATED);
4185  } elseif (!empty(‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo'])) {
4186  trigger_error('The hook "hook_previewInfo" will be removed in TYPO3 v10.0, but is still in use. Use "hook_eofe" instead.', E_USER_DEPRECATED);
4187  }
4188  if ($this->fePreview !== 0) {
4189  $previewInfo = '';
4190  $_params = ['pObj' => &$this];
4191  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_previewInfo'] ?? [] as $_funcRef) {
4192  $previewInfo .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
4193  }
4194  $this->content = str_ireplace('</body>', $previewInfo . '</body>', $this->content);
4195  }
4196  }
4197 
4203  public function ‪hook_eofe()
4204  {
4205  trigger_error('$TSFE->hook_eofe() will be removed in TYPO3 v10.0. The hook is now executed within Frontend RequestHandler.', E_USER_DEPRECATED);
4206  $_params = ['pObj' => &$this];
4207  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe'] ?? [] as $_funcRef) {
4208  GeneralUtility::callUserFunction($_funcRef, $_params, $this);
4209  }
4210  }
4217  public function ‪addTempContentHttpHeaders()
4218  {
4219  trigger_error('$TSFE->addTempContentHttpHeaders() will be removed in TYPO3 v10.0, as all headers are compiled within "processOutput" depending on various scenarios. Use $TSFE->processOutput() instead.', E_USER_DEPRECATED);
4220  header('HTTP/1.0 503 Service unavailable');
4221  $headers = $this->‪getHttpHeadersForTemporaryContent();
4222  foreach ($headers as $header => $value) {
4223  header($header . ': ' . $value);
4224  }
4225  }
4226 
4232  protected function ‪getHttpHeadersForTemporaryContent(): array
4233  {
4234  return [
4235  'Retry-after' => '3600',
4236  'Pragma' => 'no-cache',
4237  'Cache-control' => 'no-cache',
4238  'Expires' => '0',
4239  ];
4240  }
4241  /********************************************
4242  *
4243  * Various internal API functions
4244  *
4245  *******************************************/
4253  public function ‪newCObj()
4254  {
4255  $this->cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class, $this);
4256  $this->cObj->start($this->page, 'pages');
4257  }
4258 
4265  public function ‪setAbsRefPrefix()
4266  {
4267  if (!$this->absRefPrefix) {
4268  return;
4269  }
4270  $search = [
4271  '"typo3temp/',
4275  ];
4276  $replace = [
4277  '"' . $this->absRefPrefix . 'typo3temp/',
4278  '"' . $this->absRefPrefix . ‪PathUtility::stripPathSitePrefix(‪Environment::getExtensionsPath()) . '/',
4279  '"' . $this->absRefPrefix . ‪PathUtility::stripPathSitePrefix(‪Environment::getBackendPath()) . '/ext/',
4281  ];
4283  $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
4284  $storages = $storageRepository->findAll();
4285  foreach ($storages as $storage) {
4286  if ($storage->getDriverType() === 'Local' && $storage->isPublic() && $storage->isOnline()) {
4287  $folder = $storage->getPublicUrl($storage->getRootLevelFolder(), true);
4288  $search[] = '"' . $folder;
4289  $replace[] = '"' . $this->absRefPrefix . $folder;
4290  }
4291  }
4292  // Process additional directories
4293  $directories = GeneralUtility::trimExplode(',', ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['additionalAbsRefPrefixDirectories'], true);
4294  foreach ($directories as $directory) {
4295  $search[] = '"' . $directory;
4296  $replace[] = '"' . $this->absRefPrefix . $directory;
4297  }
4298  $this->content = str_replace(
4299  $search,
4300  $replace,
4301  $this->content
4302  );
4303  }
4304 
4312  public function ‪baseUrlWrap($url)
4313  {
4314  if ($this->baseUrl) {
4315  $urlParts = parse_url($url);
4316  if (empty($urlParts['scheme']) && $url[0] !== '/') {
4317  $url = $this->baseUrl . $url;
4318  }
4319  }
4320  return $url;
4321  }
4322 
4331  public function ‪logDeprecatedTyposcript($typoScriptProperty, $explanation = '')
4332  {
4333  $explanationText = $explanation !== '' ? ' - ' . $explanation : '';
4334  $this->‪getTimeTracker()->‪setTSlogMessage($typoScriptProperty . ' is deprecated.' . $explanationText, 2);
4335  trigger_error('TypoScript property ' . $typoScriptProperty . ' is deprecated' . $explanationText, E_USER_DEPRECATED);
4336  }
4337 
4338  /********************************************
4339  * PUBLIC ACCESSIBLE WORKSPACES FUNCTIONS
4340  *******************************************/
4341 
4347  public function ‪doWorkspacePreview()
4348  {
4349  return $this->context->getPropertyFromAspect('workspace', 'isOffline', false);
4350  }
4351 
4357  public function ‪whichWorkspace(): int
4358  {
4359  return $this->context->getPropertyFromAspect('workspace', 'id', 0);
4360  }
4361 
4362  /********************************************
4363  *
4364  * Various external API functions - for use in plugins etc.
4365  *
4366  *******************************************/
4367 
4373  public function ‪getPagesTSconfig()
4374  {
4375  if (!is_array($this->pagesTSconfig)) {
4376  $TSdataArray = [];
4377  foreach ($this->rootLine as $k => $v) {
4378  // add TSconfig first, as $TSdataArray is reversed below and it shall be included last
4379  $TSdataArray[] = $v['TSconfig'];
4380  if (trim($v['tsconfig_includes'])) {
4381  $includeTsConfigFileList = GeneralUtility::trimExplode(',', $v['tsconfig_includes'], true);
4382  // reverse the includes first to make sure their order is preserved when $TSdataArray is reversed
4383  $includeTsConfigFileList = array_reverse($includeTsConfigFileList);
4384  // Traversing list
4385  foreach ($includeTsConfigFileList as $includeTsConfigFile) {
4386  if (strpos($includeTsConfigFile, 'EXT:') === 0) {
4387  list($includeTsConfigFileExtensionKey, $includeTsConfigFilename) = explode(
4388  '/',
4389  substr($includeTsConfigFile, 4),
4390  2
4391  );
4392  if ((string)$includeTsConfigFileExtensionKey !== ''
4393  && (string)$includeTsConfigFilename !== ''
4394  && ‪ExtensionManagementUtility::isLoaded($includeTsConfigFileExtensionKey)
4395  ) {
4396  $extensionPath = ‪ExtensionManagementUtility::extPath($includeTsConfigFileExtensionKey);
4397  $includeTsConfigFileAndPath = ‪PathUtility::getCanonicalPath($extensionPath . $includeTsConfigFilename);
4398  if (strpos($includeTsConfigFileAndPath, $extensionPath) === 0 && file_exists($includeTsConfigFileAndPath)) {
4399  $TSdataArray[] = file_get_contents($includeTsConfigFileAndPath);
4400  }
4401  }
4402  }
4403  }
4404  }
4405  }
4406  // Adding the default configuration:
4407  $TSdataArray[] = ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'];
4408  // Bring everything in the right order. Default first, then the Rootline down to the current page
4409  $TSdataArray = array_reverse($TSdataArray);
4410  // Parsing the user TS (or getting from cache)
4411  $TSdataArray = ‪TypoScriptParser::checkIncludeLines_array($TSdataArray);
4412  $userTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
4413  $identifier = md5('pageTS:' . $userTS);
4414  $contentHashCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_hash');
4415  $this->pagesTSconfig = $contentHashCache->get($identifier);
4416  if (!is_array($this->pagesTSconfig)) {
4417  $parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
4418  $parseObj->parse($userTS);
4419  $this->pagesTSconfig = $parseObj->setup;
4420  $contentHashCache->set($identifier, $this->pagesTSconfig, ['PAGES_TSconfig'], 0);
4421  }
4422  }
4423  return ‪$this->pagesTSconfig;
4424  }
4425 
4433  public function ‪setJS($key, ‪$content = '')
4434  {
4435  if ($key) {
4436  switch ($key) {
4437  case 'mouseOver':
4438  trigger_error('$TSFE->setJS("mouseOver") will be removed in TYPO3 v10.0. If necessary, use setJS() with your recommended code.', E_USER_DEPRECATED);
4439  // Rollover functionality will be removed in TYPO3 v10.0
4440  $this->additionalJavaScript[$key] = ' // JS function for mouse-over
4441  function over(name, imgObj) { //
4442  if (document[name]) {document[name].src = eval(name+"_h.src");}
4443  else if (document.getElementById && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_h.src");}
4444  else if (imgObj) {imgObj.src = eval(name+"_h.src");}
4445  }
4446  // JS function for mouse-out
4447  function out(name, imgObj) { //
4448  if (document[name]) {document[name].src = eval(name+"_n.src");}
4449  else if (document.getElementById && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_n.src");}
4450  else if (imgObj) {imgObj.src = eval(name+"_n.src");}
4451  }';
4452  break;
4453  case 'openPic':
4454  $this->additionalJavaScript[$key] = ' function openPic(url, winName, winParams) { //
4455  var theWindow = window.open(url, winName, winParams);
4456  if (theWindow) {theWindow.focus();}
4457  }';
4458  break;
4459  default:
4460  $this->additionalJavaScript[$key] = ‪$content;
4461  }
4462  }
4463  }
4464 
4474  public function ‪setCSS($key, ‪$content)
4475  {
4476  trigger_error('$TSFE->setCSS() will be removed in TYPO3 v10.0, use PageRenderer instead to add CSS.', E_USER_DEPRECATED);
4477  if ($key) {
4478  $this->additionalCSS[$key] = ‪$content;
4479  }
4480  }
4481 
4489  public function ‪uniqueHash($str = '')
4490  {
4491  return md5($this->uniqueString . '_' . $str . $this->uniqueCounter++);
4492  }
4493 
4500  public function ‪set_no_cache($reason = '', $internal = false)
4501  {
4502  if ($reason !== '') {
4503  $warning = '$TSFE->set_no_cache() was triggered. Reason: ' . $reason . '.';
4504  } else {
4505  $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
4506  // This is a hack to work around ___FILE___ resolving symbolic links
4507  $realWebPath = ‪PathUtility::dirname(realpath(‪Environment::getBackendPath())) . '/';
4508  $file = $trace[0]['file'];
4509  if (strpos($file, $realWebPath) === 0) {
4510  $file = str_replace($realWebPath, '', $file);
4511  } else {
4512  $file = str_replace(‪Environment::getPublicPath() . '/', '', $file);
4513  }
4514  $line = $trace[0]['line'];
4515  $trigger = $file . ' on line ' . $line;
4516  $warning = '$GLOBALS[\'TSFE\']->set_no_cache() was triggered by ' . $trigger . '.';
4517  }
4518  if (!$internal && ‪$GLOBALS['TYPO3_CONF_VARS']['FE']['disableNoCacheParameter']) {
4519  $warning .= ' However, $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set, so it will be ignored!';
4520  $this->‪getTimeTracker()->‪setTSlogMessage($warning, 2);
4521  } else {
4522  $warning .= ' Caching is disabled!';
4523  $this->‪disableCache();
4524  }
4525  if ($internal && $this->‪isBackendUserLoggedIn()) {
4526  $this->logger->notice($warning);
4527  } else {
4528  $this->logger->warning($warning);
4529  }
4530  }
4531 
4537  protected function ‪disableCache()
4538  {
4539  $this->no_cache = true;
4540  }
4541 
4547  public function ‪set_cache_timeout_default($seconds)
4548  {
4549  $this->cacheTimeOutDefault = (int)$seconds;
4550  }
4551 
4557  public function ‪get_cache_timeout()
4558  {
4560  $runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_runtime');
4561  $cachedCacheLifetimeIdentifier = 'core-tslib_fe-get_cache_timeout';
4562  $cachedCacheLifetime = $runtimeCache->get($cachedCacheLifetimeIdentifier);
4563  if ($cachedCacheLifetime === false) {
4564  if ($this->page['cache_timeout']) {
4565  // Cache period was set for the page:
4566  $cacheTimeout = $this->page['cache_timeout'];
4567  } elseif ($this->cacheTimeOutDefault) {
4568  // Cache period was set for the whole site:
4569  $cacheTimeout = ‪$this->cacheTimeOutDefault;
4570  } else {
4571  // No cache period set at all, so we take one day (60*60*24 seconds = 86400 seconds):
4572  $cacheTimeout = 86400;
4573  }
4574  if (!empty($this->config['config']['cache_clearAtMidnight'])) {
4575  $timeOutTime = ‪$GLOBALS['EXEC_TIME'] + $cacheTimeout;
4576  $midnightTime = mktime(0, 0, 0, date('m', $timeOutTime), date('d', $timeOutTime), date('Y', $timeOutTime));
4577  // If the midnight time of the expire-day is greater than the current time,
4578  // we may set the timeOutTime to the new midnighttime.
4579  if ($midnightTime > ‪$GLOBALS['EXEC_TIME']) {
4580  $cacheTimeout = $midnightTime - ‪$GLOBALS['EXEC_TIME'];
4581  }
4582  }
4583 
4584  // Calculate the timeout time for records on the page and adjust cache timeout if necessary
4585  $cacheTimeout = min($this->‪calculatePageCacheTimeout(), $cacheTimeout);
4586 
4587  foreach (‪$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['get_cache_timeout'] ?? [] as $_funcRef) {
4588  $params = ['cacheTimeout' => $cacheTimeout];
4589  $cacheTimeout = GeneralUtility::callUserFunction($_funcRef, $params, $this);
4590  }
4591  $runtimeCache->set($cachedCacheLifetimeIdentifier, $cacheTimeout);
4592  $cachedCacheLifetime = $cacheTimeout;
4593  }
4594  return $cachedCacheLifetime;
4595  }
4596 
4604  public function ‪getUniqueId($desired = '')
4605  {
4606  trigger_error('$TSFE->getUniqueId() will be removed in TYPO3 v10.0, implement this functionality on your own with a proper Singleton Pattern which can be used outside of the frontend scope as well, if needed.', E_USER_DEPRECATED);
4607  if ($desired === '') {
4608  // id has to start with a letter to reach XHTML compliance
4609  $uniqueId = 'a' . $this->‪uniqueHash();
4610  } else {
4611  $uniqueId = $desired;
4612  for ($i = 1; isset($this->usedUniqueIds[$uniqueId]); $i++) {
4613  $uniqueId = $desired . '_' . $i;
4614  }
4615  }
4616  $this->usedUniqueIds[$uniqueId] = true;
4617  return $uniqueId;
4618  }
4619 
4620  /*********************************************
4621  *
4622  * Localization and character set conversion
4623  *
4624  *********************************************/
4631  public function ‪sL($input)
4632  {
4633  return $this->languageService->sL($input);
4634  }
4635 
4643  public function ‪readLLfile($fileRef)
4644  {
4645  trigger_error('$TSFE->readLLfile() will be removed in TYPO3 v10.0. The method LanguageService->includeLLFile() can be used directly.', E_USER_DEPRECATED);
4646  return $this->languageService->includeLLFile($fileRef, false, true);
4647  }
4648 
4657  public function ‪getLLL($index, $LOCAL_LANG)
4658  {
4659  trigger_error('$TSFE->getLLL() will be removed in TYPO3 v10.0. The method LanguageService->getLLL() can be used directly.', E_USER_DEPRECATED);
4660  if (isset($LOCAL_LANG[$this->lang][$index][0]['target'])) {
4661  return $LOCAL_LANG[‪$this->lang][$index][0]['target'];
4662  }
4663  if (isset($LOCAL_LANG['default'][$index][0]['target'])) {
4664  return $LOCAL_LANG['default'][$index][0]['target'];
4665  }
4666  return false;
4667  }
4668 
4675  public function ‪initLLvars()
4676  {
4677  trigger_error('$TSFE->initLLvars() will be removed in TYPO3 v10.0, the initialization can be altered via hooks within settingLanguage().', E_USER_DEPRECATED);
4678  $this->lang = $this->config['config']['language'] ?: 'default';
4679  $this->‪setOutputLanguage($this->lang);
4680 
4681  // Rendering charset of HTML page.
4682  if ($this->config['config']['metaCharset']) {
4683  $this->metaCharset = trim(strtolower($this->config['config']['metaCharset']));
4684  }
4685  }
4686 
4693  protected function ‪setOutputLanguage($language = 'default')
4694  {
4695  $this->pageRenderer->setLanguage($language);
4696  $this->languageService = GeneralUtility::makeInstance(LanguageService::class);
4697  // Always disable debugging for TSFE
4698  $this->languageService->debugKey = false;
4699  $this->languageService->init($language);
4700  }
4701 
4709  public function ‪convOutputCharset(‪$content)
4710  {
4711  if ($this->metaCharset !== 'utf-8') {
4713  $charsetConverter = GeneralUtility::makeInstance(CharsetConverter::class);
4714  try {
4715  ‪$content = $charsetConverter->conv(‪$content, 'utf-8', $this->metaCharset, true);
4716  } catch (‪UnknownCharsetException $e) {
4717  throw new \RuntimeException('Invalid config.metaCharset: ' . $e->getMessage(), 1508916185);
4718  }
4719  }
4720  return ‪$content;
4721  }
4722 
4727  public function ‪convPOSTCharset()
4728  {
4729  trigger_error('$TSFE->convPOSTCharset() will be removed in TYPO3 v10.0. A PSR-15 middleware is now taking care of the conversion. It seems you called this method from your own bootstrap code - ensure that the PrepareTypoScriptFrontendRendering middleware is called and you can remove the method call.', E_USER_DEPRECATED);
4730  if ($this->metaCharset !== 'utf-8' && is_array($_POST) && !empty($_POST)) {
4731  $this->‪convertCharsetRecursivelyToUtf8($_POST, $this->metaCharset);
4732  ‪$GLOBALS['HTTP_POST_VARS'] = $_POST;
4733  }
4734  }
4735 
4743  protected function ‪convertCharsetRecursivelyToUtf8(&$data, string $fromCharset)
4744  {
4745  foreach ($data as $key => $value) {
4746  if (is_array($data[$key])) {
4747  $this->‪convertCharsetRecursivelyToUtf8($data[$key], $fromCharset);
4748  } elseif (is_string($data[$key])) {
4749  $data[$key] = mb_convert_encoding($data[$key], 'utf-8', $fromCharset);
4750  }
4751  }
4752  }
4753 
4759  protected function ‪calculatePageCacheTimeout()
4760  {
4761  $result = PHP_INT_MAX;
4762  // Get the configuration
4763  $tablesToConsider = $this->‪getCurrentPageCacheConfiguration();
4764  // Get the time, rounded to the minute (do not pollute MySQL cache!)
4765  // It is ok that we do not take seconds into account here because this
4766  // value will be subtracted later. So we never get the time "before"
4767  // the cache change.
4768  $now = ‪$GLOBALS['ACCESS_TIME'];
4769  // Find timeout by checking every table
4770  foreach ($tablesToConsider as $tableDef) {
4771  $result = min($result, $this->‪getFirstTimeValueForRecord($tableDef, $now));
4772  }
4773  // We return + 1 second just to ensure that cache is definitely regenerated
4774  return $result === PHP_INT_MAX ? PHP_INT_MAX : $result - $now + 1;
4775  }
4776 
4791  protected function ‪getCurrentPageCacheConfiguration()
4792  {
4793  $result = ['tt_content:' . ‪$this->id];
4794  if (isset($this->config['config']['cache.'][$this->id])) {
4795  $result = array_merge($result, GeneralUtility::trimExplode(',', $this->config['config']['cache.'][$this->id]));
4796  }
4797  if (isset($this->config['config']['cache.']['all'])) {
4798  $result = array_merge($result, GeneralUtility::trimExplode(',', $this->config['config']['cache.']['all']));
4799  }
4800  return array_unique($result);
4801  }
4802 
4812  protected function ‪getFirstTimeValueForRecord($tableDef, $now)
4813  {
4814  $now = (int)$now;
4815  $result = PHP_INT_MAX;
4816  list($tableName, $pid) = GeneralUtility::trimExplode(':', $tableDef);
4817  if (empty($tableName) || empty($pid)) {
4818  throw new \InvalidArgumentException('Unexpected value for parameter $tableDef. Expected <tablename>:<pid>, got \'' . htmlspecialchars($tableDef) . '\'.', 1307190365);
4819  }
4820 
4821  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
4822  ->getQueryBuilderForTable($tableName);
4823  $queryBuilder->getRestrictions()
4824  ->removeByType(StartTimeRestriction::class)
4825  ->removeByType(EndTimeRestriction::class);
4826  $timeFields = [];
4827  $timeConditions = $queryBuilder->expr()->orX();
4828  foreach (['starttime', 'endtime'] as $field) {
4829  if (isset($GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns'][$field])) {
4830  $timeFields[$field] = $GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns'][$field];
4831  $queryBuilder->addSelectLiteral(
4832  'MIN('
4833  . 'CASE WHEN '
4834  . $queryBuilder->expr()->lte(
4835  $timeFields[$field],
4836  $queryBuilder->createNamedParameter($now, \PDO::PARAM_INT)
4837  )
4838  . ' THEN NULL ELSE ' . $queryBuilder->quoteIdentifier($timeFields[$field]) . ' END'
4839  . ') AS ' . $queryBuilder->quoteIdentifier($timeFields[$field])
4840  );
4841  $timeConditions->add(
4842  $queryBuilder->expr()->gt(
4843  $timeFields[$field],
4844  $queryBuilder->createNamedParameter($now, \PDO::PARAM_INT)
4845  )
4846  );
4847  }
4848  }
4849 
4850  // if starttime or endtime are defined, evaluate them
4851  if (!empty($timeFields)) {
4852  // find the timestamp, when the current page's content changes the next time
4853  $row = $queryBuilder
4854  ->from($tableName)
4855  ->where(
4856  $queryBuilder->expr()->eq(
4857  'pid',
4858  $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)
4859  ),
4860  $timeConditions
4861  )
4862  ->execute()
4863  ->fetch();
4864 
4865  if ($row) {
4866  foreach ($timeFields as $timeField => $_) {
4867  // if a MIN value is found, take it into account for the
4868  // cache lifetime we have to filter out start/endtimes < $now,
4869  // as the SQL query also returns rows with starttime < $now
4870  // and endtime > $now (and using a starttime from the past
4871  // would be wrong)
4872  if ($row[$timeField] !== null && (int)$row[$timeField] > $now) {
4873  $result = min($result, (int)$row[$timeField]);
4874  }
4875  }
4876  }
4877  }
4878 
4879  return $result;
4880  }
4881 
4890  public function ‪domainNameMatchesCurrentRequest($domainName)
4891  {
4892  trigger_error('$TSFE->domainNameMatchesCurrentRequest() will be removed in TYPO3 v10.0, use LegacyDomainResolver instead.', E_USER_DEPRECATED);
4893  $currentDomain = GeneralUtility::getIndpEnv('HTTP_HOST');
4894  $currentPathSegment = trim(preg_replace('|/[^/]*$|', '', GeneralUtility::getIndpEnv('SCRIPT_NAME')));
4895  return $currentDomain === $domainName || $currentDomain . $currentPathSegment === $domainName;
4896  }
4897 
4906  public function ‪getDomainDataForPid($targetPid)
4907  {
4908  trigger_error('$TSFE->getDomainDataForPid() will be removed in TYPO3 v10.0, use LegacyDomainResolver instead.', E_USER_DEPRECATED);
4909  return GeneralUtility::makeInstance(LegacyDomainResolver::class)->matchPageId((int)$targetPid, ‪$GLOBALS['TYPO3_REQUEST']);
4910  }
4911 
4920  public function ‪getDomainNameForPid($targetPid)
4921  {
4922  trigger_error('$TSFE->getDomainNameForPid() will be removed in TYPO3 v10.0, use LegacyDomainResolver instead.', E_USER_DEPRECATED);
4923  $domainData = GeneralUtility::makeInstance(LegacyDomainResolver::class)->matchPageId((int)$targetPid, ‪$GLOBALS['TYPO3_REQUEST']);
4924  return $domainData ? $domainData['domainName'] : null;
4925  }
4926 
4933  public function ‪getRequestedId()
4934  {
4935  return $this->requestedId ?: ‪$this->id;
4936  }
4972  protected function ‪acquireLock(‪$type, $key)
4973  {
4974  $lockFactory = GeneralUtility::makeInstance(LockFactory::class);
4975  $this->locks[‪$type]['accessLock'] = $lockFactory->createLocker(‪$type);
4976 
4977  $this->locks[‪$type]['pageLock'] = $lockFactory->createLocker(
4978  $key,
4980  );
4981 
4982  do {
4983  if (!$this->locks[‪$type]['accessLock']->acquire()) {
4984  throw new \RuntimeException('Could not acquire access lock for "' . ‪$type . '"".', 1294586098);
4985  }
4986 
4987  try {
4988  $locked = $this->locks[‪$type]['pageLock']->acquire(
4990  );
4991  } catch (LockAcquireWouldBlockException $e) {
4992  // somebody else has the lock, we keep waiting
4994  // first release the access lock
4995  $this->locks[‪$type]['accessLock']->release();
4996  // now lets make a short break (100ms) until we try again, since
4997  // the page generation by the lock owner will take a while anyways
4998  usleep(100000);
4999  continue;
5000  }
5001  $this->locks[‪$type]['accessLock']->release();
5002  if ($locked) {
5003  break;
5004  }
5005  throw new \RuntimeException('Could not acquire page lock for ' . $key . '.', 1460975877);
5006  } while (true);
5007  }
5008 
5017  protected function ‪releaseLock(‪$type)
5018  {
5019  if ($this->locks[‪$type]['accessLock']) {
5020  if (!$this->locks[‪$type]['accessLock']->acquire()) {
5021  throw new \RuntimeException('Could not acquire access lock for "' . ‪$type . '"".', 1460975902);
5022  }
5023 
5024  $this->locks[‪$type]['pageLock']->release();
5025  $this->locks[‪$type]['pageLock']->destroy();
5026  $this->locks[‪$type]['pageLock'] = null;
5027 
5028  $this->locks[‪$type]['accessLock']->release();
5029  $this->locks[‪$type]['accessLock'] = null;
5030  }
5031  }
5032 
5038  protected function ‪getAdditionalHeaders(): array
5039  {
5040  if (!isset($this->config['config']['additionalHeaders.'])) {
5041  return [];
5042  }
5043  $additionalHeaders = [];
5044  ksort($this->config['config']['additionalHeaders.']);
5045  foreach ($this->config['config']['additionalHeaders.'] as $options) {
5046  if (!is_array($options)) {
5047  continue;
5048  }
5049  $header = trim($options['header'] ?? '');
5050  if ($header === '') {
5051  continue;
5052  }
5053  $additionalHeaders[] = [
5054  'header' => $header,
5055  // "replace existing headers" is turned on by default, unless turned off
5056  'replace' => ($options['replace'] ?? '') !== '0',
5057  'statusCode' => (int)($options['httpResponseCode'] ?? 0) ?: null
5058  ];
5059  }
5060  return $additionalHeaders;
5061  }
5062 
5063  protected function ‪isInPreviewMode(): bool
5064  {
5065  return $this->fePreview
5066  || ‪$GLOBALS['EXEC_TIME'] !== ‪$GLOBALS['SIM_EXEC_TIME']
5067  || $this->context->getPropertyFromAspect('visibility', 'includeHiddenPages', false)
5068  || $this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false);
5069  }
5070 
5076  protected function ‪getBackendUser()
5077  {
5078  return ‪$GLOBALS['BE_USER'];
5079  }
5080 
5084  protected function ‪getTimeTracker()
5085  {
5086  return GeneralUtility::makeInstance(TimeTracker::class);
5087  }
5094  protected function ‪getCurrentSiteLanguage(): ?‪SiteLanguage
5095  {
5096  if (isset(‪$GLOBALS['TYPO3_REQUEST'])
5097  && ‪$GLOBALS['TYPO3_REQUEST'] instanceof ServerRequestInterface
5098  && ‪$GLOBALS['TYPO3_REQUEST']->getAttribute('language') instanceof ‪SiteLanguage) {
5099  return ‪$GLOBALS['TYPO3_REQUEST']->getAttribute('language');
5100  }
5101  return null;
5102  }
5103 
5119  public function ‪__isset(string $propertyName)
5120  {
5121  switch ($propertyName) {
5122  case 'sys_language_uid':
5123  trigger_error('Property $TSFE->sys_language_uid is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5124  return isset($this->$propertyName);
5125  case 'sys_language_content':
5126  trigger_error('Property $TSFE->sys_language_content is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5127  return isset($this->$propertyName);
5128  case 'sys_language_contentOL':
5129  trigger_error('Property $TSFE->sys_language_contentOL is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5130  return isset($this->$propertyName);
5131  case 'sys_language_mode':
5132  trigger_error('Property $TSFE->sys_language_mode is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5133  return isset($this->$propertyName);
5134  case 'loginUser':
5135  trigger_error('Property $TSFE->loginUser is not in use anymore as this information is now stored within the frontend.user aspect.', E_USER_DEPRECATED);
5136  return isset($this->$propertyName);
5137  case 'gr_list':
5138  trigger_error('Property $TSFE->gr_list is not in use anymore as this information is now stored within the frontend.user aspect.', E_USER_DEPRECATED);
5139  return isset($this->$propertyName);
5140  case 'beUserLogin':
5141  trigger_error('Property $TSFE->beUserLogin is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5142  return isset($this->$propertyName);
5143  case 'showHiddenPage':
5144  trigger_error('Property $TSFE->showHiddenPage is not in use anymore as this information is now stored within the visibility aspect.', E_USER_DEPRECATED);
5145  return isset($this->$propertyName);
5146  case 'showHiddenRecords':
5147  trigger_error('Property $TSFE->showHiddenRecords is not in use anymore as this information is now stored within the visibility aspect.', E_USER_DEPRECATED);
5148  return isset($this->$propertyName);
5149  case 'ADMCMD_preview_BEUSER_uid':
5150  trigger_error('Property $TSFE->ADMCMD_preview_BEUSER_uid is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5151  return isset($this->$propertyName);
5152  case 'workspacePreview':
5153  trigger_error('Property $TSFE->workspacePreview is not in use anymore as this information is now stored within the workspace aspect.', E_USER_DEPRECATED);
5154  return isset($this->$propertyName);
5155  case 'loginAllowedInBranch':
5156  trigger_error('Property $TSFE->loginAllowedInBranch is marked as protected now as it only contains internal state. Use checkIfLoginAllowedInBranch() instead.', E_USER_DEPRECATED);
5157  return isset($this->$propertyName);
5158  // Regular deprecations / property visibility changes
5159  case 'loginAllowedInBranch_mode':
5160  case 'cacheTimeOutDefault':
5161  case 'cacheContentFlag':
5162  case 'cacheExpires':
5163  case 'isClientCachable':
5164  case 'no_cacheBeforePageGen':
5165  case 'tempContent':
5166  case 'pagesTSconfig':
5167  case 'pageCacheTags':
5168  case 'uniqueCounter':
5169  case 'uniqueString':
5170  case 'lang':
5171  case 'MP_defaults':
5172  case 'debug':
5173  case 'pageAccessFailureHistory':
5174  trigger_error('Property $TSFE->' . $propertyName . ' is marked as protected now as it only contains internal state.', E_USER_DEPRECATED);
5175  return isset($this->$propertyName);
5176  }
5177  return false;
5178  }
5179 
5189  public function ‪__get(string $propertyName)
5190  {
5191  switch ($propertyName) {
5192  case 'sys_language_uid':
5193  trigger_error('Property $TSFE->sys_language_uid is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5194  return $this->context->getPropertyFromAspect('language', 'id', 0);
5195  case 'sys_language_content':
5196  trigger_error('Property $TSFE->sys_language_content is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5197  return $this->context->getPropertyFromAspect('language', 'contentId', 0);
5198  case 'sys_language_contentOL':
5199  trigger_error('Property $TSFE->sys_language_contentOL is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5200  return $this->context->getPropertyFromAspect('language', 'legacyOverlayType', '0');
5201  case 'sys_language_mode':
5202  trigger_error('Property $TSFE->sys_language_mode is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5203  return $this->context->getPropertyFromAspect('language', 'legacyLanguageMode', '');
5204  case 'loginUser':
5205  trigger_error('Property $TSFE->loginUser is not in use anymore as this information is now stored within the frontend.user aspect.', E_USER_DEPRECATED);
5206  return $this->context->getPropertyFromAspect('frontend.user', 'isLoggedIn', false);
5207  case 'gr_list':
5208  trigger_error('Property $TSFE->gr_list is not in use anymore as this information is now stored within the frontend.user aspect.', E_USER_DEPRECATED);
5209  return implode(',', $this->context->getPropertyFromAspect('frontend.user', 'groupIds', [0, -1]));
5210  case 'beUserLogin':
5211  trigger_error('Property $TSFE->beUserLogin is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5212  return $this->context->getPropertyFromAspect('backend.user', 'isLoggedIn', false);
5213  case 'showHiddenPage':
5214  trigger_error('Property $TSFE->showHiddenPage is not in use anymore as this information is now stored within the visibility aspect.', E_USER_DEPRECATED);
5215  return $this->context->getPropertyFromAspect('visibility', 'includeHiddenPages', false);
5216  case 'showHiddenRecords':
5217  trigger_error('Property $TSFE->showHiddenRecords is not in use anymore as this information is now stored within the visibility aspect.', E_USER_DEPRECATED);
5218  return $this->context->getPropertyFromAspect('visibility', 'includeHiddenContent', false);
5219  case 'ADMCMD_preview_BEUSER_uid':
5220  trigger_error('Property $TSFE->ADMCMD_preview_BEUSER_uid is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5221  return $this->context->getPropertyFromAspect('backend.user', 'id', 0);
5222  case 'workspacePreview':
5223  trigger_error('Property $TSFE->workspacePreview is not in use anymore as this information is now stored within the workspace aspect.', E_USER_DEPRECATED);
5224  return $this->context->getPropertyFromAspect('workspace', 'id', 0);
5225  case 'loginAllowedInBranch':
5226  trigger_error('Property $TSFE->loginAllowedInBranch is marked as protected now as it only contains internal state. Use checkIfLoginAllowedInBranch() instead.', E_USER_DEPRECATED);
5227  break;
5228  // Regular deprecations / property visibility changes
5229  case 'loginAllowedInBranch_mode':
5230  case 'cacheTimeOutDefault':
5231  case 'cacheContentFlag':
5232  case 'cacheExpires':
5233  case 'isClientCachable':
5234  case 'no_cacheBeforePageGen':
5235  case 'tempContent':
5236  case 'pagesTSconfig':
5237  case 'pageCacheTags':
5238  case 'uniqueCounter':
5239  case 'uniqueString':
5240  case 'lang':
5241  case 'MP_defaults':
5242  case 'debug':
5243  case 'pageAccessFailureHistory':
5244  trigger_error('Property $TSFE->' . $propertyName . ' is marked as protected now as it only contains internal state.', E_USER_DEPRECATED);
5245  break;
5246  }
5247  return $this->$propertyName;
5248  }
5249 
5261  public function ‪__set(string $propertyName, $propertyValue)
5262  {
5263  switch ($propertyName) {
5264  case 'sys_language_uid':
5265  trigger_error('Property $TSFE->sys_language_uid is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5267  $aspect = $this->context->getAspect('language');
5268  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, (int)$propertyValue, $aspect->getContentId(), $aspect->getOverlayType(), $aspect->getFallbackChain()));
5269  break;
5270  case 'sys_language_content':
5271  trigger_error('Property $TSFE->sys_language_content is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5273  $aspect = $this->context->getAspect('language');
5274  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, $aspect->getId(), (int)$propertyValue, $aspect->getOverlayType(), $aspect->getFallbackChain()));
5275  break;
5276  case 'sys_language_contentOL':
5277  trigger_error('Property $TSFE->sys_language_contentOL is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5279  $aspect = $this->context->getAspect('language');
5280  switch ((string)$propertyValue) {
5281  case 'hideNonTranslated':
5283  break;
5284  case '1':
5285  $overlayType = ‪LanguageAspect::OVERLAYS_MIXED;
5286  break;
5287  default:
5288  $overlayType = ‪LanguageAspect::OVERLAYS_OFF;
5289  }
5290  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, $aspect->getId(), $aspect->getContentId(), $overlayType, $aspect->getFallbackChain()));
5291  break;
5292  case 'sys_language_mode':
5293  trigger_error('Property $TSFE->sys_language_mode is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5295  $aspect = $this->context->getAspect('language');
5296  switch ((string)$propertyValue) {
5297  case 'strict':
5298  $fallBackOrder = [];
5299  break;
5300  // Ignore anything if a page cannot be found, and resolve pageId=0 instead.
5301  case 'ignore':
5302  $fallBackOrder = [-1];
5303  break;
5304  case 'fallback':
5305  case 'content_fallback':
5306  if (!empty($propertyValue)) {
5307  $fallBackOrder = GeneralUtility::trimExplode(',', $propertyValue);
5308  // no strict typing explictly done here
5309  if (!in_array(0, $fallBackOrder) && !in_array('pageNotFound', $fallBackOrder)) {
5310  $fallBackOrder[] = 'pageNotFound';
5311  }
5312  } else {
5313  $fallBackOrder = [0];
5314  }
5315  break;
5316  case '':
5317  $fallBackOrder = ['off'];
5318  break;
5319  default:
5320  $fallBackOrder = [0];
5321  }
5322  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, $aspect->getId(), $aspect->getContentId(), $aspect->getOverlayType(), $fallBackOrder));
5323  break;
5324  case 'loginUser':
5325  trigger_error('Property $TSFE->loginUser is not in use anymore as this information is now stored within the frontend.user aspect.', E_USER_DEPRECATED);
5327  $aspect = $this->context->getAspect('frontend.user');
5328  if ($propertyValue) {
5329  $aspect = GeneralUtility::makeInstance(UserAspect::class, $this->fe_user ?: null, $aspect->getGroupIds());
5330  } else {
5331  $aspect = GeneralUtility::makeInstance(UserAspect::class, null, $aspect->getGroupIds());
5332  }
5333  $this->context->setAspect('frontend.user', $aspect);
5334  break;
5335  case 'gr_list':
5336  trigger_error('Property $TSFE->gr_list is not in use anymore as this information is now stored within the frontend.user aspect.', E_USER_DEPRECATED);
5337  $this->context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, $this->fe_user ?: null, GeneralUtility::intExplode(',', $propertyValue)));
5338  break;
5339  case 'beUserLogin':
5340  trigger_error('Property $TSFE->beUserLogin is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5341  if ($propertyValue) {
5342  $aspect = GeneralUtility::makeInstance(UserAspect::class, ‪$GLOBALS['BE_USER']);
5343  } else {
5344  $aspect = GeneralUtility::makeInstance(UserAspect::class);
5345  }
5346  $this->context->setAspect('backend.user', $aspect);
5347  break;
5348  case 'showHiddenPage':
5349  case 'showHiddenRecords':
5350  trigger_error('Property $TSFE->' . $propertyName . ' is not in use anymore as this information is now stored within the visibility aspect.', E_USER_DEPRECATED);
5352  $aspect = $this->context->getAspect('visibility');
5353  if ($propertyName === 'showHiddenPage') {
5354  $newAspect = GeneralUtility::makeInstance(VisibilityAspect::class, (bool)$propertyValue, $aspect->includeHiddenContent(), $aspect->includeDeletedRecords());
5355  } else {
5356  $newAspect = GeneralUtility::makeInstance(VisibilityAspect::class, $aspect->includeHiddenPages(), (bool)$propertyValue, $aspect->includeDeletedRecords());
5357  }
5358  $this->context->setAspect('visibility', $newAspect);
5359  break;
5360  case 'ADMCMD_preview_BEUSER_uid':
5361  trigger_error('Property $TSFE->ADMCMD_preview_BEUSER_uid is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5362  // No need to update an aspect here
5363  break;
5364  case 'workspacePreview':
5365  trigger_error('Property $TSFE->workspacePreview is not in use anymore as this information is now stored within the workspace aspect.', E_USER_DEPRECATED);
5366  $this->context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, (int)$propertyValue));
5367  break;
5368  case 'loginAllowedInBranch':
5369  trigger_error('Property $TSFE->loginAllowedInBranch is marked as protected now as it only contains internal state. Use checkIfLoginAllowedInBranch() instead.', E_USER_DEPRECATED);
5370  break;
5371  // Regular deprecations / property visibility changes
5372  case 'loginAllowedInBranch_mode':
5373  case 'cacheTimeOutDefault':
5374  case 'cacheContentFlag':
5375  case 'cacheExpires':
5376  case 'isClientCachable':
5377  case 'no_cacheBeforePageGen':
5378  case 'tempContent':
5379  case 'pagesTSconfig':
5380  case 'pageCacheTags':
5381  case 'uniqueCounter':
5382  case 'uniqueString':
5383  case 'lang':
5384  case 'MP_defaults':
5385  case 'debug':
5386  case 'pageAccessFailureHistory':
5387  trigger_error('Property $TSFE->' . $propertyName . ' is marked as protected now as it only contains internal state.', E_USER_DEPRECATED);
5388  break;
5389  }
5390  $this->$propertyName = $propertyValue;
5391  }
5392 
5398  public function ‪__unset(string $propertyName)
5399  {
5400  switch ($propertyName) {
5401  case 'sys_language_uid':
5402  trigger_error('Property $TSFE->sys_language_uid is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5403  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class));
5404  break;
5405  case 'sys_language_content':
5406  trigger_error('Property $TSFE->sys_language_content is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5408  $aspect = $this->context->getAspect('language');
5409  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, $aspect->getId(), 0, $aspect->getOverlayType()));
5410  break;
5411  case 'sys_language_contentOL':
5412  trigger_error('Property $TSFE->sys_language_contentOL is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5414  $aspect = $this->context->getAspect('language');
5415  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, $aspect->getId(), $aspect->getContentId(), ‪LanguageAspect::OVERLAYS_OFF));
5416  break;
5417  case 'sys_language_mode':
5418  trigger_error('Property $TSFE->sys_language_mode is not in use anymore as this information is now stored within the language aspect.', E_USER_DEPRECATED);
5420  $aspect = $this->context->getAspect('language');
5421  $this->context->setAspect('language', GeneralUtility::makeInstance(LanguageAspect::class, $aspect->getId(), $aspect->getContentId(), $aspect->getOverlayType(), ['off']));
5422  break;
5423  case 'loginUser':
5425  $aspect = $this->context->getAspect('frontend.user');
5426  $this->context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, null, $aspect->getGroupIds()));
5427  break;
5428  case 'gr_list':
5429  trigger_error('Property $TSFE->gr_list is not in use anymore as this information is now stored within the frontend.user aspect.', E_USER_DEPRECATED);
5430  $this->context->setAspect('frontend.user', GeneralUtility::makeInstance(UserAspect::class, $this->fe_user ?: null, []));
5431  break;
5432  case 'beUserLogin':
5433  trigger_error('Property $TSFE->beUserLogin is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5434  $this->context->setAspect('backend.user', GeneralUtility::makeInstance(UserAspect::class));
5435  break;
5436  case 'showHiddenPage':
5437  case 'showHiddenRecords':
5438  trigger_error('Property $TSFE->' . $propertyName . ' is not in use anymore as this information is now stored within the visibility aspect.', E_USER_DEPRECATED);
5440  $aspect = $this->context->getAspect('visibility');
5441  if ($propertyName === 'showHiddenPage') {
5442  $newAspect = GeneralUtility::makeInstance(VisibilityAspect::class, false, $aspect->includeHiddenContent(), $aspect->includeDeletedRecords());
5443  } else {
5444  $newAspect = GeneralUtility::makeInstance(VisibilityAspect::class, $aspect->includeHiddenPages(), false, $aspect->includeDeletedRecords());
5445  }
5446  $this->context->setAspect('visibility', $newAspect);
5447  break;
5448  case 'ADMCMD_preview_BEUSER_uid':
5449  trigger_error('Property $TSFE->ADMCMD_preview_BEUSER_uid is not in use anymore as this information is now stored within the backend.user aspect.', E_USER_DEPRECATED);
5450  // No need to update an aspect here
5451  break;
5452  case 'workspacePreview':
5453  trigger_error('Property $TSFE->workspacePreview is not in use anymore as this information is now stored within the workspace aspect.', E_USER_DEPRECATED);
5454  $this->context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, 0));
5455  break;
5456  case 'loginAllowedInBranch':
5457  trigger_error('Property $TSFE->loginAllowedInBranch is marked as protected now as it only contains internal state. Use checkIfLoginAllowedInBranch() instead.', E_USER_DEPRECATED);
5458  break;
5459  // Regular deprecations / property visibility changes
5460  case 'loginAllowedInBranch_mode':
5461  case 'cacheTimeOutDefault':
5462  case 'cacheContentFlag':
5463  case 'cacheExpires':
5464  case 'isClientCachable':
5465  case 'no_cacheBeforePageGen':
5466  case 'tempContent':
5467  case 'pagesTSconfig':
5468  case 'uniqueCounter':
5469  case 'uniqueString':
5470  case 'lang':
5471  case 'MP_defaults':
5472  case 'debug':
5473  case 'pageAccessFailureHistory':
5474  trigger_error('Property $TSFE->' . $propertyName . ' is marked as protected now as it only contains internal state.', E_USER_DEPRECATED);
5475  break;
5476  }
5477  unset($this->$propertyName);
5478  }
5479 }
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$tempContent
‪mixed $tempContent
Definition: TypoScriptFrontendController.php:395
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$tmpl
‪TemplateService $tmpl
Definition: TypoScriptFrontendController.php:317
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$requestedId
‪int $requestedId
Definition: TypoScriptFrontendController.php:743
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\redirectToExternalUrl
‪ResponseInterface null redirectToExternalUrl($calledFromCore=false)
Definition: TypoScriptFrontendController.php:2935
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getDomainNameForPid
‪mixed getDomainNameForPid($targetPid)
Definition: TypoScriptFrontendController.php:4819
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE
‪const LANGUAGE_AND_FALLBACKS_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:41
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getCurrentPageCacheConfiguration
‪array getCurrentPageCacheConfiguration()
Definition: TypoScriptFrontendController.php:4690
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$xhtmlDoctype
‪string $xhtmlDoctype
Definition: TypoScriptFrontendController.php:733
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\contentStrReplace
‪contentStrReplace()
Definition: TypoScriptFrontendController.php:4028
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initPageRenderer
‪initPageRenderer()
Definition: TypoScriptFrontendController.php:805
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setAbsRefPrefix
‪setAbsRefPrefix()
Definition: TypoScriptFrontendController.php:4164
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sys_language_uid
‪int $sys_language_uid
Definition: TypoScriptFrontendController.php:544
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getUniqueId
‪string getUniqueId($desired='')
Definition: TypoScriptFrontendController.php:4503
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\processContentForOutput
‪processContentForOutput()
Definition: TypoScriptFrontendController.php:3895
‪TYPO3\CMS\Core\Routing\PageArguments
Definition: PageArguments.php:25
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\pageNotFoundHandler
‪pageNotFoundHandler($code, $header='', $reason='')
Definition: TypoScriptFrontendController.php:1957
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$siteScript
‪string $siteScript
Definition: TypoScriptFrontendController.php:224
‪TYPO3\CMS\Core\Context\VisibilityAspect
Definition: VisibilityAspect.php:29
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\convOutputCharset
‪string convOutputCharset($content)
Definition: TypoScriptFrontendController.php:4608
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$debug
‪bool $debug
Definition: TypoScriptFrontendController.php:463
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$usedUniqueIds
‪array $usedUniqueIds
Definition: TypoScriptFrontendController.php:664
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\doWorkspacePreview
‪bool doWorkspacePreview()
Definition: TypoScriptFrontendController.php:4246
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$contentType
‪string $contentType
Definition: TypoScriptFrontendController.php:727
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_MOUNTPOINT
‪const DOKTYPE_MOUNTPOINT
Definition: PageRepository.php:172
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$no_cacheBeforePageGen
‪bool $no_cacheBeforePageGen
Definition: TypoScriptFrontendController.php:386
‪TYPO3\CMS\Core\Utility\PathUtility
Definition: PathUtility.php:23
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$lang
‪string $lang
Definition: TypoScriptFrontendController.php:688
‪TYPO3\CMS\Core\Context\WorkspaceAspect
Definition: WorkspaceAspect.php:29
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$uniqueCounter
‪int $uniqueCounter
Definition: TypoScriptFrontendController.php:635
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:73
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$simUserGroup
‪int $simUserGroup
Definition: TypoScriptFrontendController.php:305
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getRedirectUriForMountPoint
‪string null getRedirectUriForMountPoint(ServerRequestInterface $request)
Definition: TypoScriptFrontendController.php:3110
‪TYPO3\CMS\Core\Context\LanguageAspectFactory
Definition: LanguageAspectFactory.php:25
‪TYPO3\CMS\Core\Controller\ErrorPageController
Definition: ErrorPageController.php:31
‪TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_MIXED
‪const OVERLAYS_MIXED
Definition: LanguageAspect.php:73
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:153
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$additionalCSS
‪array $additionalCSS
Definition: TypoScriptFrontendController.php:444
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\mergingWithGetVars
‪mergingWithGetVars($GET_VARS)
Definition: TypoScriptFrontendController.php:2132
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\calculateLinkVars
‪calculateLinkVars(array $queryParams=null)
Definition: TypoScriptFrontendController.php:2973
‪TYPO3\CMS\Core\Localization\Locales\initialize
‪static Locales initialize()
Definition: Locales.php:135
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$currentRecord
‪string $currentRecord
Definition: TypoScriptFrontendController.php:610
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkIfLoginAllowedInBranch
‪bool checkIfLoginAllowedInBranch()
Definition: TypoScriptFrontendController.php:1792
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$displayFieldEditIcons
‪string $displayFieldEditIcons
Definition: TypoScriptFrontendController.php:535
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cacheExpires
‪int $cacheExpires
Definition: TypoScriptFrontendController.php:337
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getAdditionalHeaders
‪getAdditionalHeaders()
Definition: TypoScriptFrontendController.php:4937
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\splitLinkVarsString
‪array splitLinkVarsString(string $string)
Definition: TypoScriptFrontendController.php:3043
‪TYPO3\CMS\Core\Database\Query\Restriction\EndTimeRestriction
Definition: EndTimeRestriction.php:25
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageShortcut
‪mixed getPageShortcut($SC, $mode, $thisUid, $itera=20, $pageLog=[], $disableGroupCheck=false)
Definition: TypoScriptFrontendController.php:1636
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$applicationData
‪array $applicationData
Definition: TypoScriptFrontendController.php:580
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\newCObj
‪newCObj()
Definition: TypoScriptFrontendController.php:4152
‪TYPO3\CMS\Core\Utility\PathUtility\dirname
‪static string dirname($path)
Definition: PathUtility.php:185
‪TYPO3\CMS\Core\Exception
Definition: Exception.php:21
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\sL
‪string sL($input)
Definition: TypoScriptFrontendController.php:4530
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$linkVars
‪string $linkVars
Definition: TypoScriptFrontendController.php:522
‪TYPO3\CMS\Backend\FrontendBackendUserAuthentication
Definition: FrontendBackendUserAuthentication.php:35
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
Definition: TypoScriptParser.php:37
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePageTitle
‪string generatePageTitle()
Definition: TypoScriptFrontendController.php:3570
‪TYPO3\CMS\Core\Database\Query\Restriction\StartTimeRestriction
Definition: StartTimeRestriction.php:25
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_SHORTCUT
‪const DOKTYPE_SHORTCUT
Definition: PageRepository.php:170
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\headerNoCache
‪bool headerNoCache()
Definition: TypoScriptFrontendController.php:2404
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setUrlIdToken
‪setUrlIdToken()
Definition: TypoScriptFrontendController.php:2958
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cacheTimeOutDefault
‪bool int $cacheTimeOutDefault
Definition: TypoScriptFrontendController.php:324
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$beUserLogin
‪bool $beUserLogin
Definition: TypoScriptFrontendController.php:252
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\applyPreviewSettings
‪string null applyPreviewSettings($backendUser=null)
Definition: TypoScriptFrontendController.php:1151
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initLLvars
‪initLLvars()
Definition: TypoScriptFrontendController.php:4574
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getLockHash
‪string getLockHash()
Definition: TypoScriptFrontendController.php:2440
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePage_preProcessing
‪generatePage_preProcessing()
Definition: TypoScriptFrontendController.php:3392
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkEnableFields
‪bool checkEnableFields($row, $bypassGroupCheck=false)
Definition: TypoScriptFrontendController.php:1733
‪TYPO3\CMS\Frontend\Http\UrlHandlerInterface
Definition: UrlHandlerInterface.php:25
‪TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix
‪static string stripPathSitePrefix($path)
Definition: PathUtility.php:371
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAccessFailureReasons
‪array getPageAccessFailureReasons(string $failureReasonCode=null)
Definition: TypoScriptFrontendController.php:1822
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\applyHttpHeadersToResponse
‪ResponseInterface applyHttpHeadersToResponse(ResponseInterface $response)
Definition: TypoScriptFrontendController.php:3914
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\__set
‪__set(string $propertyName, $propertyValue)
Definition: TypoScriptFrontendController.php:5160
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$no_cache
‪bool $no_cache
Definition: TypoScriptFrontendController.php:136
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cacheContentFlag
‪bool $cacheContentFlag
Definition: TypoScriptFrontendController.php:331
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\storeSessionData
‪storeSessionData()
Definition: TypoScriptFrontendController.php:4068
‪TYPO3
‪TYPO3\CMS\Core\Locking\LockingStrategyInterface\LOCK_CAPABILITY_NOBLOCK
‪const LOCK_CAPABILITY_NOBLOCK
Definition: LockingStrategyInterface.php:39
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cHash
‪string $cHash
Definition: TypoScriptFrontendController.php:125
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\makeCacheHash
‪makeCacheHash()
Definition: TypoScriptFrontendController.php:2175
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setContentType
‪setContentType($contentType)
Definition: TypoScriptFrontendController.php:818
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$MP
‪string $MP
Definition: TypoScriptFrontendController.php:208
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$indexedDocTitle
‪string $indexedDocTitle
Definition: TypoScriptFrontendController.php:646
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\clear_preview
‪clear_preview()
Definition: TypoScriptFrontendController.php:1002
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\disableCache
‪disableCache()
Definition: TypoScriptFrontendController.php:4436
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sys_page
‪PageRepository $sys_page
Definition: TypoScriptFrontendController.php:175
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\uniqueHash
‪string uniqueHash($str='')
Definition: TypoScriptFrontendController.php:4388
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$register
‪array $register
Definition: TypoScriptFrontendController.php:584
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\set_no_cache
‪set_no_cache($reason='', $internal=false)
Definition: TypoScriptFrontendController.php:4399
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$gr_list
‪string $gr_list
Definition: TypoScriptFrontendController.php:246
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initializeRedirectUrlHandlers
‪initializeRedirectUrlHandlers($calledFromCore=false)
Definition: TypoScriptFrontendController.php:2893
‪TYPO3\CMS\Frontend\Resource\FilePathSanitizer
Definition: FilePathSanitizer.php:37
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sys_language_isocode
‪string $sys_language_isocode
Definition: TypoScriptFrontendController.php:574
‪TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange
‪static int forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
Definition: MathUtility.php:31
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_SPACER
‪const DOKTYPE_SPACER
Definition: PageRepository.php:173
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\baseUrlWrap
‪string baseUrlWrap($url)
Definition: TypoScriptFrontendController.php:4211
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isInPreviewMode
‪isInPreviewMode()
Definition: TypoScriptFrontendController.php:4962
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pageArguments
‪PageArguments $pageArguments
Definition: TypoScriptFrontendController.php:130
‪TYPO3\CMS\Core\Utility\RootlineUtility
Definition: RootlineUtility.php:36
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$additionalFooterData
‪array $additionalFooterData
Definition: TypoScriptFrontendController.php:431
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\CACHEHASH_EMPTY
‪const CACHEHASH_EMPTY
Definition: PageAccessFailureReasons.php:36
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$extTarget
‪string $extTarget
Definition: TypoScriptFrontendController.php:473
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$metaCharset
‪string $metaCharset
Definition: TypoScriptFrontendController.php:682
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$intTarget
‪string $intTarget
Definition: TypoScriptFrontendController.php:468
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\handleDataSubmission
‪handleDataSubmission()
Definition: TypoScriptFrontendController.php:2876
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\pageErrorHandler
‪pageErrorHandler($code, $header='', $reason='')
Definition: TypoScriptFrontendController.php:1973
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getConfigArray
‪getConfigArray()
Definition: TypoScriptFrontendController.php:2497
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\pageUnavailableAndExit
‪pageUnavailableAndExit($reason='', $header='')
Definition: TypoScriptFrontendController.php:1888
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getCurrentSiteLanguage
‪getCurrentSiteLanguage()
Definition: TypoScriptFrontendController.php:4993
‪TYPO3\CMS\Core\Locking\LockingStrategyInterface
Definition: LockingStrategyInterface.php:25
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\createHashBase
‪string createHashBase($createLockHashBase=false)
Definition: TypoScriptFrontendController.php:2456
‪TYPO3\CMS\Core\Localization\Locales
Definition: Locales.php:29
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pageCache
‪TYPO3 CMS Core Cache Frontend FrontendInterface $pageCache
Definition: TypoScriptFrontendController.php:709
‪TYPO3\CMS\Core\Charset\CharsetConverter
Definition: CharsetConverter.php:54
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript_process
‪INTincScript_process($INTiS_config)
Definition: TypoScriptFrontendController.php:3728
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setRegisterValueForSysLastChanged
‪setRegisterValueForSysLastChanged(array $page)
Definition: TypoScriptFrontendController.php:3346
‪TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule
‪static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=true, $includeEmptyValues=true, $enableUnsetFeature=true)
Definition: ArrayUtility.php:614
‪TYPO3\CMS\Core\Context\LanguageAspectFactory\createFromSiteLanguage
‪static LanguageAspect createFromSiteLanguage(SiteLanguage $language)
Definition: LanguageAspectFactory.php:102
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$type
‪int $type
Definition: TypoScriptFrontendController.php:119
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$fileTarget
‪string $fileTarget
Definition: TypoScriptFrontendController.php:478
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$activeUrlHandlers
‪TYPO3 CMS Frontend Http UrlHandlerInterface[] $activeUrlHandlers
Definition: TypoScriptFrontendController.php:185
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$workspacePreview
‪int $workspacePreview
Definition: TypoScriptFrontendController.php:259
‪TYPO3\CMS\Core\Locking\LockingStrategyInterface\LOCK_CAPABILITY_EXCLUSIVE
‪const LOCK_CAPABILITY_EXCLUSIVE
Definition: LockingStrategyInterface.php:29
‪TYPO3\CMS\Core\Utility\PathUtility\getCanonicalPath
‪static string getCanonicalPath($path)
Definition: PathUtility.php:306
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getDomainDataForPid
‪mixed getDomainDataForPid($targetPid)
Definition: TypoScriptFrontendController.php:4805
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$forceTemplateParsing
‪bool $forceTemplateParsing
Definition: TypoScriptFrontendController.php:400
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isUserOrGroupSet
‪bool isUserOrGroupSet()
Definition: TypoScriptFrontendController.php:970
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$imagesOnPage
‪array $imagesOnPage
Definition: TypoScriptFrontendController.php:622
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pageAccessFailureHistory
‪array $pageAccessFailureHistory
Definition: TypoScriptFrontendController.php:203
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkAndSetAlias
‪checkAndSetAlias()
Definition: TypoScriptFrontendController.php:2114
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_INVALID_PAGETYPE
‪const ACCESS_DENIED_INVALID_PAGETYPE
Definition: PageAccessFailureReasons.php:49
‪TYPO3\CMS\Core\Locking\Exception\LockAcquireWouldBlockException
Definition: LockAcquireWouldBlockException.php:21
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:49
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$deprecatedPublicMethods
‪$deprecatedPublicMethods
Definition: TypoScriptFrontendController.php:101
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$JSCode
‪string $JSCode
Definition: TypoScriptFrontendController.php:448
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$showHiddenPage
‪bool $showHiddenPage
Definition: TypoScriptFrontendController.php:291
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\pageUnavailableHandler
‪pageUnavailableHandler($code, $header, $reason)
Definition: TypoScriptFrontendController.php:1943
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\addTempContentHttpHeaders
‪addTempContentHttpHeaders()
Definition: TypoScriptFrontendController.php:4116
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$xhtmlVersion
‪int $xhtmlVersion
Definition: TypoScriptFrontendController.php:737
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\determineId
‪determineId()
Definition: TypoScriptFrontendController.php:1087
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getBackendUser
‪TYPO3 CMS Backend FrontendBackendUserAuthentication getBackendUser()
Definition: TypoScriptFrontendController.php:4975
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:23
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\sendCacheHeaders
‪sendCacheHeaders()
Definition: TypoScriptFrontendController.php:3952
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isStaticCacheble
‪bool isStaticCacheble()
Definition: TypoScriptFrontendController.php:4019
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getHash
‪string getHash()
Definition: TypoScriptFrontendController.php:2428
‪TYPO3\CMS\Core\Core\Environment\getFrameworkBasePath
‪static string getFrameworkBasePath()
Definition: Environment.php:234
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAndRootlineWithDomain
‪getPageAndRootlineWithDomain($domainStartPage)
Definition: TypoScriptFrontendController.php:1859
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$page
‪array $page
Definition: TypoScriptFrontendController.php:146
‪TYPO3\CMS\Core\Context\Context\setAspect
‪setAspect(string $name, AspectInterface $aspect)
Definition: Context.php:141
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\clearPageCacheContent
‪clearPageCacheContent()
Definition: TypoScriptFrontendController.php:3296
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$registerStack
‪array $registerStack
Definition: TypoScriptFrontendController.php:590
‪TYPO3\CMS\Core\Site\Entity\Site
Definition: Site.php:39
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getRedirectUriForShortcut
‪string null getRedirectUriForShortcut(ServerRequestInterface $request)
Definition: TypoScriptFrontendController.php:3144
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\recursivelyReplaceIntPlaceholdersInContent
‪recursivelyReplaceIntPlaceholdersInContent()
Definition: TypoScriptFrontendController.php:3710
‪TYPO3\CMS\Core\Utility\HttpUtility\HTTP_STATUS_307
‪const HTTP_STATUS_307
Definition: HttpUtility.php:47
‪TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication\getCookieName
‪static string getCookieName()
Definition: FrontendUserAuthentication.php:137
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$additionalHeaderData
‪array $additionalHeaderData
Definition: TypoScriptFrontendController.php:426
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_GENERAL
‪const ACCESS_DENIED_GENERAL
Definition: PageAccessFailureReasons.php:45
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility
Definition: ExtensionManagementUtility.php:36
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$page_cache_reg1
‪int $page_cache_reg1
Definition: TypoScriptFrontendController.php:216
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getCacheHeaders
‪array getCacheHeaders()
Definition: TypoScriptFrontendController.php:3966
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:25
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\settingLocale
‪settingLocale()
Definition: TypoScriptFrontendController.php:2818
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$ADMCMD_preview_BEUSER_uid
‪int $ADMCMD_preview_BEUSER_uid
Definition: TypoScriptFrontendController.php:276
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\realPageCacheContent
‪realPageCacheContent()
Definition: TypoScriptFrontendController.php:3226
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$lastImageInfo
‪array $lastImageInfo
Definition: TypoScriptFrontendController.php:628
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setOutputLanguage
‪setOutputLanguage($language='default')
Definition: TypoScriptFrontendController.php:4592
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\fetch_the_id
‪fetch_the_id()
Definition: TypoScriptFrontendController.php:1306
‪TYPO3\CMS\Frontend\Compatibility\LegacyDomainResolver
Definition: LegacyDomainResolver.php:37
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getCookieName
‪static string getCookieName()
Definition: BackendUserAuthentication.php:2529
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\setTSlogMessage
‪setTSlogMessage($content, $num=0)
Definition: TimeTracker.php:193
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:35
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isINTincScript
‪bool isINTincScript()
Definition: TypoScriptFrontendController.php:3809
‪TYPO3\CMS\Core\Context\LanguageAspectFactory\createFromTypoScript
‪static LanguageAspect createFromTypoScript(array $config)
Definition: LanguageAspectFactory.php:36
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initUserGroups
‪initUserGroups()
Definition: TypoScriptFrontendController.php:922
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\__isset
‪bool __isset(string $propertyName)
Definition: TypoScriptFrontendController.php:5018
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\determineIdIsHiddenPage
‪bool determineIdIsHiddenPage()
Definition: TypoScriptFrontendController.php:1182
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\reqCHash
‪reqCHash()
Definition: TypoScriptFrontendController.php:2214
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\__construct
‪__construct($_=null, $id, $type, $no_cache=null, $cHash='', $_2=null, $MP='')
Definition: TypoScriptFrontendController.php:766
‪TYPO3\CMS\Core\Error\Http\PageNotFoundException
Definition: PageNotFoundException.php:21
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$locks
‪LockingStrategyInterface[][] $locks
Definition: TypoScriptFrontendController.php:698
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_HOST_PAGE_MISMATCH
‪const ACCESS_DENIED_HOST_PAGE_MISMATCH
Definition: PageAccessFailureReasons.php:48
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageAndRootline
‪getPageAndRootline()
Definition: TypoScriptFrontendController.php:1455
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$fe_user
‪FrontendUserAuthentication $fe_user
Definition: TypoScriptFrontendController.php:230
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_PAGE_NOT_RESOLVED
‪const ACCESS_DENIED_PAGE_NOT_RESOLVED
Definition: PageAccessFailureReasons.php:46
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$accessKey
‪array $accessKey
Definition: TypoScriptFrontendController.php:616
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPageCacheTags
‪array getPageCacheTags()
Definition: TypoScriptFrontendController.php:3379
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$loginAllowedInBranch_mode
‪string $loginAllowedInBranch_mode
Definition: TypoScriptFrontendController.php:270
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\previewInfo
‪previewInfo($isCoreCall=false)
Definition: TypoScriptFrontendController.php:4080
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkRootlineForIncludeSection
‪bool checkRootlineForIncludeSection()
Definition: TypoScriptFrontendController.php:1666
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFromCache_queryRow
‪array getFromCache_queryRow()
Definition: TypoScriptFrontendController.php:2389
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_DEFAULT_NOT_AVAILABLE
‪const LANGUAGE_DEFAULT_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:42
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFirstTimeValueForRecord
‪int getFirstTimeValueForRecord($tableDef, $now)
Definition: TypoScriptFrontendController.php:4711
‪TYPO3\CMS\Frontend\Page\PageRepository
Definition: PageRepository.php:53
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\processOutput
‪processOutput()
Definition: TypoScriptFrontendController.php:3846
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cHash_array
‪array $cHash_array
Definition: TypoScriptFrontendController.php:406
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pageRenderer
‪PageRenderer $pageRenderer
Definition: TypoScriptFrontendController.php:702
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkPageUnavailableHandler
‪bool checkPageUnavailableHandler()
Definition: TypoScriptFrontendController.php:1918
‪TYPO3\CMS\Core\Utility\HttpUtility\buildQueryString
‪static string buildQueryString(array $parameters, string $prependCharacter='', bool $skipEmptyParameters=false)
Definition: HttpUtility.php:160
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setCSS
‪setCSS($key, $content)
Definition: TypoScriptFrontendController.php:4373
‪TYPO3\CMS\Core\PageTitle\PageTitleProviderManager
Definition: PageTitleProviderManager.php:28
‪TYPO3\CMS\Core\Resource\StorageRepository
Definition: StorageRepository.php:29
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_NOT_AVAILABLE
‪const LANGUAGE_NOT_AVAILABLE
Definition: PageAccessFailureReasons.php:39
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\PAGE_NOT_FOUND
‪const PAGE_NOT_FOUND
Definition: PageAccessFailureReasons.php:26
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pageNotFound
‪int $pageNotFound
Definition: TypoScriptFrontendController.php:191
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$ATagParams
‪string $ATagParams
Definition: TypoScriptFrontendController.php:500
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isGeneratePage
‪bool isGeneratePage()
Definition: TypoScriptFrontendController.php:3218
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$getMethodUrlIdToken
‪string $getMethodUrlIdToken
Definition: TypoScriptFrontendController.php:377
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_CONFIGURED
‪const RENDERING_INSTRUCTIONS_NOT_CONFIGURED
Definition: PageAccessFailureReasons.php:32
‪TYPO3\CMS\Core\Http\ServerRequestFactory
Definition: ServerRequestFactory.php:28
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\pull
‪pull($content='')
Definition: TimeTracker.php:173
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$loginAllowedInBranch
‪bool $loginAllowedInBranch
Definition: TypoScriptFrontendController.php:264
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkAlternativeIdMethods
‪checkAlternativeIdMethods()
Definition: TypoScriptFrontendController.php:986
‪TYPO3\CMS\Core\Error\Http\ServiceUnavailableException
Definition: ServiceUnavailableException.php:21
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded
‪static bool isLoaded($key, $exitOnError=null)
Definition: ExtensionManagementUtility.php:115
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$contentPid
‪int $contentPid
Definition: TypoScriptFrontendController.php:152
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$absRefPrefix
‪string $absRefPrefix
Definition: TypoScriptFrontendController.php:495
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:34
‪TYPO3\CMS\Core\Service\DependencyOrderingService
Definition: DependencyOrderingService.php:31
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$spamProtectEmailAddresses
‪string int $spamProtectEmailAddresses
Definition: TypoScriptFrontendController.php:490
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$loginUser
‪bool $loginUser
Definition: TypoScriptFrontendController.php:238
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\convertCharsetRecursivelyToUtf8
‪convertCharsetRecursivelyToUtf8(&$data, string $fromCharset)
Definition: TypoScriptFrontendController.php:4642
‪TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser\checkIncludeLines_array
‪static array checkIncludeLines_array(array $array)
Definition: TypoScriptParser.php:1214
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ACCESS_DENIED_SUBSECTION_NOT_RESOLVED
‪const ACCESS_DENIED_SUBSECTION_NOT_RESOLVED
Definition: PageAccessFailureReasons.php:47
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sWordList
‪string $sWordList
Definition: TypoScriptFrontendController.php:515
‪TYPO3\CMS\Core\Core\Environment\getBackendPath
‪static string getBackendPath()
Definition: Environment.php:223
‪TYPO3\CMS\Core\Charset\UnknownCharsetException
Definition: UnknownCharsetException.php:23
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkPageGroupAccess
‪bool checkPageGroupAccess($row)
Definition: TypoScriptFrontendController.php:1759
‪TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW
‪const PAGE_SHOW
Definition: Permission.php:32
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\domainNameMatchesCurrentRequest
‪bool domainNameMatchesCurrentRequest($domainName)
Definition: TypoScriptFrontendController.php:4789
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\get_cache_timeout
‪int get_cache_timeout()
Definition: TypoScriptFrontendController.php:4456
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\preparePageContentGeneration
‪preparePageContentGeneration(ServerRequestInterface $request=null)
Definition: TypoScriptFrontendController.php:3410
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\readLLfile
‪array readLLfile($fileRef)
Definition: TypoScriptFrontendController.php:4542
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$id
‪string $id
Definition: TypoScriptFrontendController.php:114
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\settingLanguage
‪settingLanguage()
Definition: TypoScriptFrontendController.php:2632
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sys_language_contentOL
‪int string $sys_language_contentOL
Definition: TypoScriptFrontendController.php:568
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$context
‪Context $context
Definition: TypoScriptFrontendController.php:750
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initializeBackendUser
‪FrontendBackendUserAuthentication initializeBackendUser()
Definition: TypoScriptFrontendController.php:1029
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getHttpHeadersForTemporaryContent
‪getHttpHeadersForTemporaryContent()
Definition: TypoScriptFrontendController.php:4131
‪TYPO3\CMS\Core\Context\LanguageAspect
Definition: LanguageAspect.php:55
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\sendHttpHeadersDirectly
‪sendHttpHeadersDirectly()
Definition: TypoScriptFrontendController.php:3858
‪TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait
Definition: PublicMethodDeprecationTrait.php:68
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$newHash
‪string $newHash
Definition: TypoScriptFrontendController.php:368
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\convPOSTCharset
‪convPOSTCharset()
Definition: TypoScriptFrontendController.php:4626
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$all
‪array $all
Definition: TypoScriptFrontendController.php:350
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\printTitle
‪string printTitle(string $pageTitle, bool $noTitle=false, bool $showTitleFirst=false, string $pageTitleSeparator='')
Definition: TypoScriptFrontendController.php:3637
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\releaseLocks
‪releaseLocks()
Definition: TypoScriptFrontendController.php:3359
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$isClientCachable
‪bool $isClientCachable
Definition: TypoScriptFrontendController.php:343
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\NO_PAGES_FOUND
‪const NO_PAGES_FOUND
Definition: PageAccessFailureReasons.php:25
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\LANGUAGE_NOT_AVAILABLE_STRICT_MODE
‪const LANGUAGE_NOT_AVAILABLE_STRICT_MODE
Definition: PageAccessFailureReasons.php:40
‪$output
‪$output
Definition: annotationChecker.php:113
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\whichWorkspace
‪int whichWorkspace()
Definition: TypoScriptFrontendController.php:4256
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\hook_eofe
‪hook_eofe()
Definition: TypoScriptFrontendController.php:4102
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$additionalJavaScript
‪array $additionalJavaScript
Definition: TypoScriptFrontendController.php:438
‪debug
‪debug($variable='', $title=null, $group=null)
Definition: GlobalDebugFunctions.php:5
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$inlineJS
‪string $inlineJS
Definition: TypoScriptFrontendController.php:452
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\clearPageCacheContent_pidList
‪clearPageCacheContent_pidList($pidList)
Definition: TypoScriptFrontendController.php:3306
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setPageCacheContent
‪setPageCacheContent($content, $data, $expirationTstamp)
Definition: TypoScriptFrontendController.php:3256
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:31
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\logDeprecatedTyposcript
‪logDeprecatedTyposcript($typoScriptProperty, $explanation='')
Definition: TypoScriptFrontendController.php:4230
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript
‪INTincScript()
Definition: TypoScriptFrontendController.php:3659
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cacheHash
‪CacheHashCalculator $cacheHash
Definition: TypoScriptFrontendController.php:719
‪TYPO3\CMS\Core\TypoScript\TemplateService
Definition: TemplateService.php:50
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$displayEditIcons
‪string $displayEditIcons
Definition: TypoScriptFrontendController.php:528
‪TYPO3\CMS\Core\Error\Http\ShortcutTargetPageNotFoundException
Definition: ShortcutTargetPageNotFoundException.php:22
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isAllowedLinkVarValue
‪bool isAllowedLinkVarValue(string $haystack, string $needle)
Definition: TypoScriptFrontendController.php:3066
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\connectToDB
‪connectToDB()
Definition: TypoScriptFrontendController.php:831
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initTemplate
‪initTemplate()
Definition: TypoScriptFrontendController.php:2254
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\addCacheTags
‪addCacheTags(array $tags)
Definition: TypoScriptFrontendController.php:3371
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:97
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$recordRegister
‪array $recordRegister
Definition: TypoScriptFrontendController.php:602
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setJS
‪setJS($key, $content='')
Definition: TypoScriptFrontendController.php:4332
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:23
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sys_language_content
‪int $sys_language_content
Definition: TypoScriptFrontendController.php:557
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$uniqueString
‪string $uniqueString
Definition: TypoScriptFrontendController.php:640
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sys_language_mode
‪string $sys_language_mode
Definition: TypoScriptFrontendController.php:550
‪TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
Definition: DeletedRestriction.php:26
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\CACHEHASH_COMPARISON_FAILED
‪const CACHEHASH_COMPARISON_FAILED
Definition: PageAccessFailureReasons.php:35
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkTranslatedShortcut
‪checkTranslatedShortcut(int $languageId)
Definition: TypoScriptFrontendController.php:2854
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getUriToCurrentPageForRedirect
‪string getUriToCurrentPageForRedirect(ServerRequestInterface $request)
Definition: TypoScriptFrontendController.php:3190
‪TYPO3\CMS\Core\Log\LogManager
Definition: LogManager.php:25
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getLLL
‪string false getLLL($index, $LOCAL_LANG)
Definition: TypoScriptFrontendController.php:4556
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initializeSearchWordData
‪initializeSearchWordData($searchWords)
Definition: TypoScriptFrontendController.php:3508
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sPre
‪string $sPre
Definition: TypoScriptFrontendController.php:355
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$fePreview
‪int $fePreview
Definition: TypoScriptFrontendController.php:284
‪TYPO3\CMS\Frontend\Page\CacheHashCalculator
Definition: CacheHashCalculator.php:24
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\PAGE_ALIAS_NOT_FOUND
‪const PAGE_ALIAS_NOT_FOUND
Definition: PageAccessFailureReasons.php:27
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\INTincScript_loadJSCode
‪INTincScript_loadJSCode()
Definition: TypoScriptFrontendController.php:3774
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:21
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
Definition: ContentObjectRenderer.php:91
‪TYPO3\CMS\Core\Locking\LockFactory
Definition: LockFactory.php:24
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setSysLastChanged
‪setSysLastChanged()
Definition: TypoScriptFrontendController.php:3320
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\__get
‪mixed __get(string $propertyName)
Definition: TypoScriptFrontendController.php:5088
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkPageForMountpointRedirect
‪checkPageForMountpointRedirect()
Definition: TypoScriptFrontendController.php:3126
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\set_cache_timeout_default
‪set_cache_timeout_default($seconds)
Definition: TypoScriptFrontendController.php:4446
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_RECYCLER
‪const DOKTYPE_RECYCLER
Definition: PageRepository.php:175
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath
‪static string extPath($key, $script='')
Definition: ExtensionManagementUtility.php:149
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getRequestedId
‪int getRequestedId()
Definition: TypoScriptFrontendController.php:4832
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$MP_defaults
‪array $MP_defaults
Definition: TypoScriptFrontendController.php:485
‪TYPO3\CMS\Frontend\Controller
Definition: ErrorController.php:3
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getPagesTSconfig
‪array getPagesTSconfig()
Definition: TypoScriptFrontendController.php:4272
‪TYPO3\CMS\Core\Exception\Page\RootLineException
Definition: RootLineException.php:24
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$sWordRegEx
‪string $sWordRegEx
Definition: TypoScriptFrontendController.php:508
‪TYPO3\CMS\Core\Utility\HttpUtility
Definition: HttpUtility.php:21
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\updateRootLinesWithTranslations
‪updateRootLinesWithTranslations()
Definition: TypoScriptFrontendController.php:2805
‪TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_OFF
‪const OVERLAYS_OFF
Definition: LanguageAspect.php:72
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cObj
‪ContentObjectRenderer $cObj
Definition: TypoScriptFrontendController.php:670
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
Definition: FrontendUserAuthentication.php:28
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$cObjectDepthCounter
‪int $cObjectDepthCounter
Definition: TypoScriptFrontendController.php:596
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pSetup
‪array $pSetup
Definition: TypoScriptFrontendController.php:361
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$domainStartPage
‪int $domainStartPage
Definition: TypoScriptFrontendController.php:197
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$originalShortcutPage
‪array null $originalShortcutPage
Definition: TypoScriptFrontendController.php:169
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkPagerecordForIncludeSection
‪bool checkPagerecordForIncludeSection(array $row)
Definition: TypoScriptFrontendController.php:1782
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\__unset
‪__unset(string $propertyName)
Definition: TypoScriptFrontendController.php:5297
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$languageService
‪LanguageService $languageService
Definition: TypoScriptFrontendController.php:694
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\calculatePageCacheTimeout
‪int calculatePageCacheTimeout()
Definition: TypoScriptFrontendController.php:4658
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\generatePage_postProcessing
‪generatePage_postProcessing()
Definition: TypoScriptFrontendController.php:3528
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isOutputting
‪bool isOutputting()
Definition: TypoScriptFrontendController.php:3825
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$config
‪array $config
Definition: TypoScriptFrontendController.php:311
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pagesTSconfig
‪array $pagesTSconfig
Definition: TypoScriptFrontendController.php:412
‪TYPO3\CMS\Core\Context\LanguageAspect\OVERLAYS_ON_WITH_FLOATING
‪const OVERLAYS_ON_WITH_FLOATING
Definition: LanguageAspect.php:75
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\setPageArguments
‪setPageArguments(PageArguments $pageArguments)
Definition: TypoScriptFrontendController.php:2245
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getTimeTracker
‪TimeTracker getTimeTracker()
Definition: TypoScriptFrontendController.php:4983
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$originalMountPointPage
‪array null $originalMountPointPage
Definition: TypoScriptFrontendController.php:160
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$content
‪string $content
Definition: TypoScriptFrontendController.php:675
‪TYPO3\CMS\Core\Http\ImmediateResponseException
Definition: ImmediateResponseException.php:29
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$rootLine
‪array $rootLine
Definition: TypoScriptFrontendController.php:141
‪TYPO3\CMS\Core\Utility\HttpUtility\redirect
‪static redirect($url, $httpStatus=self::HTTP_STATUS_303)
Definition: HttpUtility.php:103
‪TYPO3\CMS\Core\TimeTracker\TimeTracker
Definition: TimeTracker.php:27
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\isBackendUserLoggedIn
‪bool isBackendUserLoggedIn()
Definition: TypoScriptFrontendController.php:1018
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$altPageTitle
‪string $altPageTitle
Definition: TypoScriptFrontendController.php:653
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\releaseLock
‪releaseLock($type)
Definition: TypoScriptFrontendController.php:4916
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$showHiddenRecords
‪bool $showHiddenRecords
Definition: TypoScriptFrontendController.php:299
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initCaches
‪initCaches()
Definition: TypoScriptFrontendController.php:873
‪TYPO3\CMS\Core\Context\DateTimeAspect
Definition: DateTimeAspect.php:33
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\pageNotFoundAndExit
‪pageNotFoundAndExit($reason='', $header='')
Definition: TypoScriptFrontendController.php:1903
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$divSection
‪string $divSection
Definition: TypoScriptFrontendController.php:457
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons
Definition: PageAccessFailureReasons.php:23
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\ROOTLINE_BROKEN
‪const ROOTLINE_BROKEN
Definition: PageAccessFailureReasons.php:28
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\getFromCache
‪getFromCache()
Definition: TypoScriptFrontendController.php:2267
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\DATABASE_CONNECTION_FAILED
‪const DATABASE_CONNECTION_FAILED
Definition: PageAccessFailureReasons.php:52
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\initFEuser
‪initFEuser()
Definition: TypoScriptFrontendController.php:882
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\checkPageForShortcutRedirect
‪checkPageForShortcutRedirect()
Definition: TypoScriptFrontendController.php:3160
‪TYPO3\CMS\Core\Context\UserAspect
Definition: UserAspect.php:36
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\redirectToCurrentPage
‪redirectToCurrentPage()
Definition: TypoScriptFrontendController.php:3173
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$pageCacheTags
‪array $pageCacheTags
Definition: TypoScriptFrontendController.php:713
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\resolveTranslatedPageId
‪resolveTranslatedPageId()
Definition: TypoScriptFrontendController.php:1602
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\$baseUrl
‪string $baseUrl
Definition: TypoScriptFrontendController.php:658
‪TYPO3\CMS\Core\Http\ServerRequestFactory\fromGlobals
‪static ServerRequest fromGlobals()
Definition: ServerRequestFactory.php:36
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController\acquireLock
‪acquireLock($type, $key)
Definition: TypoScriptFrontendController.php:4871
‪TYPO3\CMS\Core\Core\Environment\getExtensionsPath
‪static string getExtensionsPath()
Definition: Environment.php:245
‪TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_BE_USER_SECTION
‪const DOKTYPE_BE_USER_SECTION
Definition: PageRepository.php:171
‪TYPO3\CMS\Frontend\Page\PageAccessFailureReasons\RENDERING_INSTRUCTIONS_NOT_FOUND
‪const RENDERING_INSTRUCTIONS_NOT_FOUND
Definition: PageAccessFailureReasons.php:31
‪TYPO3\CMS\Core\TimeTracker\TimeTracker\push
‪push($tslabel, $value='')
Definition: TimeTracker.php:147