468 'onmousemove' => array(),
469 'onmouseup' => array(),
470 'onkeydown' => array(),
471 'onkeyup' => array(),
472 'onkeypress' => array(),
474 'onunload' => array()
973 if ($this->TYPO3_CONF_VARS[
'FE'][
'disableNoCacheParameter']) {
974 $warning =
'&no_cache=1 has been ignored because $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set!';
975 $GLOBALS[
'TT']->setTSlogMessage($warning, 2);
977 $warning =
'&no_cache=1 has been supplied, so caching is disabled! URL: "' .
GeneralUtility::getIndpEnv(
'TYPO3_REQUEST_URL') .
'"';
984 $this->MP = $this->TYPO3_CONF_VARS[
'FE'][
'enable_mount_pids'] ? (string)
$MP :
'';
987 $this->uniqueString = md5(microtime());
990 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'tslib_fe-PostProc'])) {
991 $_params = array(
'pObj' => &$this);
992 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'tslib_fe-PostProc'] as $_funcRef) {
1011 }
catch (\RuntimeException $exception) {
1012 switch ($exception->getCode()) {
1015 $message =
'Cannot connect to the configured database "' . TYPO3_db .
'"';
1020 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message, 1301648782);
1025 $message =
'The current username, password or host was not accepted when' .
' the connection to the database was attempted to be established!';
1030 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException(
'Database Error: ' . $message, 1301648945);
1038 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'connectToDB'])) {
1039 $_params = array(
'pObj' => &$this);
1040 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'connectToDB'] as $_funcRef) {
1056 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'params',
'cache_md5params',
'md5hash=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($this->RDCT,
'cache_md5params'));
1057 if ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
1059 header(
'Location: ' . $row[
'params']);
1071 if (!isset($this->pageRenderer)) {
1073 $this->pageRenderer->setTemplateFile(PATH_tslib .
'templates/tslib_page_frontend.html');
1074 $this->pageRenderer->setBackPath(TYPO3_mainDir);
1109 $this->fe_user->lockIP = $this->TYPO3_CONF_VARS[
'FE'][
'lockIP'];
1110 $this->fe_user->checkPid = $this->TYPO3_CONF_VARS[
'FE'][
'checkFeUserPid'];
1111 $this->fe_user->lifetime = (int)$this->TYPO3_CONF_VARS[
'FE'][
'lifetime'];
1114 $this->fe_user->checkPid_value = $pid ?
$GLOBALS[
'TYPO3_DB']->cleanIntList($pid) : 0;
1119 if (md5(($fe_sParts[0] .
'/' . $this->TYPO3_CONF_VARS[
'SYS'][
'encryptionKey'])) === (
string)$fe_sParts[1]) {
1121 $_COOKIE[$cookieName] = $fe_sParts[0];
1122 if (isset($_SERVER[
'HTTP_COOKIE'])) {
1124 $_SERVER[
'HTTP_COOKIE'] .=
';' . $cookieName .
'=' . $fe_sParts[0];
1126 $this->fe_user->forceSetCookie = 1;
1127 $this->fe_user->dontSetCookie = FALSE;
1131 $this->fe_user->start();
1132 $this->fe_user->unpack_uc(
'');
1134 $this->fe_user->fetchSessionData();
1137 if (is_array($recs)) {
1138 $this->fe_user->record_registration($recs, $this->TYPO3_CONF_VARS[
'FE'][
'maxSessionDataSize']);
1141 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'initFEuser'])) {
1142 $_params = array(
'pObj' => &$this);
1143 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'initFEuser'] as $_funcRef) {
1148 if (is_array($this->fe_user->user) && $this->fe_user->user[
'uid'] && $this->fe_user->user[
'is_online'] <
$GLOBALS[
'EXEC_TIME'] - 60) {
1149 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'fe_users',
'uid=' . (
int)$this->fe_user->user[
'uid'], array(
'is_online' =>
$GLOBALS[
'EXEC_TIME']));
1164 $this->fe_user->fetchGroupData();
1165 if (is_array($this->fe_user->user) && count($this->fe_user->groupData[
'uid'])) {
1167 $this->loginUser = TRUE;
1169 $this->gr_list =
'0,-2';
1170 $gr_array = $this->fe_user->groupData[
'uid'];
1172 $this->loginUser = FALSE;
1174 $this->gr_list =
'0,-1';
1175 if ($this->loginAllowedInBranch) {
1177 $gr_array = $this->fe_user->groupData[
'uid'];
1180 $gr_array = array();
1185 $gr_array = array_unique($gr_array);
1188 if (count($gr_array) && !$this->loginAllowedInBranch_mode) {
1189 $this->gr_list .=
',' . implode(
',', $gr_array);
1191 if ($this->fe_user->writeDevLog) {
1192 GeneralUtility::devLog(
'Valid usergroups for TSFE: ' . $this->gr_list,
'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController');
1203 return is_array($this->fe_user->user) || $this->gr_list !==
'0,-1';
1218 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'checkAlternativeIdMethods-PostProc'])) {
1219 $_params = array(
'pObj' => &$this);
1220 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'checkAlternativeIdMethods-PostProc'] as $_funcRef) {
1234 $this->showHiddenPage = FALSE;
1235 $this->showHiddenRecords = FALSE;
1238 $this->fePreview = 0;
1255 public function initializeBackendUser() {
1257 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/index_ts.php'][
'preBeUser'])) {
1258 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/index_ts.php'][
'preBeUser'] as $_funcRef) {
1267 if ($_COOKIE[\
TYPO3\CMS\Core\Authentication\BackendUserAuthentication::getCookieName()]) {
1268 $GLOBALS[
'TYPO3_MISC'][
'microtime_BE_USER_start'] = microtime(TRUE);
1269 $GLOBALS[
'TT']->push(
'Back End user initialized',
'');
1279 $BE_USER->lockIP = $this->TYPO3_CONF_VARS[
'BE'][
'lockIP'];
1283 if (!empty(
$BE_USER->user[
'uid'])) {
1285 $this->beUserLogin = TRUE;
1288 if (!
$BE_USER->checkLockToIP() || !
$BE_USER->checkBackendAccessSettingsFromInitPhp() || empty(
$BE_USER->user[
'uid'])) {
1290 $this->beUserLogin = FALSE;
1291 $_SESSION[
'TYPO3-TT-start'] = FALSE;
1294 $GLOBALS[
'TYPO3_MISC'][
'microtime_BE_USER_end'] = microtime(TRUE);
1297 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/index_ts.php'][
'postBeUser'])) {
1301 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/index_ts.php'][
'postBeUser'] as $_funcRef) {
1316 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'determineId-PreProcessing'])) {
1317 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'determineId-PreProcessing'] as $functionReference) {
1325 $GLOBALS[
'TT']->push(
'beUserLogin',
'');
1326 $originalFrontendUser = NULL;
1329 if ($this->beUserLogin &&
$GLOBALS[
'BE_USER']->adminPanel instanceof \
TYPO3\CMS\Frontend\View\AdminPanelView) {
1330 $this->fePreview = (bool)
$GLOBALS[
'BE_USER']->adminPanel->extGetFeAdminValue(
'preview');
1332 if ($this->fePreview) {
1333 if ($this->fe_user->user) {
1334 $originalFrontendUser = $this->fe_user->user;
1336 $this->showHiddenPage = (bool)
$GLOBALS[
'BE_USER']->adminPanel->extGetFeAdminValue(
'preview',
'showHiddenPages');
1337 $this->showHiddenRecords = (bool)
$GLOBALS[
'BE_USER']->adminPanel->extGetFeAdminValue(
'preview',
'showHiddenRecords');
1339 $simTime =
$GLOBALS[
'BE_USER']->adminPanel->extGetFeAdminValue(
'preview',
'simulateDate');
1341 $GLOBALS[
'SIM_EXEC_TIME'] = $simTime;
1342 $GLOBALS[
'SIM_ACCESS_TIME'] = $simTime - $simTime % 60;
1345 $simUserGroup =
$GLOBALS[
'BE_USER']->adminPanel->extGetFeAdminValue(
'preview',
'simulateUserGroup');
1348 if ($this->fe_user->user) {
1349 $this->fe_user->user[$this->fe_user->usergroup_column] =
$simUserGroup;
1351 $this->fe_user->user = array(
1356 if (!
$simUserGroup && !$simTime && !$this->showHiddenPage && !$this->showHiddenRecords) {
1357 $this->fePreview = 0;
1364 $this->fePreview = 1;
1365 $this->showHiddenPage = TRUE;
1371 $temp_sys_page->init($this->showHiddenPage);
1373 if (!count($temp_sys_page->getRootLine($this->id, $this->MP)) && $temp_sys_page->error_getRootLine_failPid == -1) {
1375 $temp_sys_page->versioningPreview = TRUE;
1376 if (count($temp_sys_page->getRootLine($this->id, $this->MP))) {
1378 $this->fePreview = 1;
1386 $GLOBALS[
'BE_USER']->user[
'workspace_preview']
1397 $this->fePreview = 2;
1400 if ($this->fePreview) {
1408 if ($this->beUserLogin && $this->fePreview) {
1409 if (!
$GLOBALS[
'BE_USER']->doesUserHaveAccess($this->page, 1)) {
1412 $this->fe_user->user = $originalFrontendUser;
1420 if (!$this->loginAllowedInBranch) {
1423 if ($this->loginAllowedInBranch_mode ==
'all') {
1425 $this->fe_user->hideActiveLogin();
1426 $this->gr_list =
'0,-1';
1428 $this->gr_list =
'0,-2';
1436 $this->
id = ($this->contentPid = (int)$this->
id);
1438 $this->type = (int)$this->type;
1440 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'determineId-PostProc'])) {
1441 $_params = array(
'pObj' => &$this);
1442 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'determineId-PostProc'] as $_funcRef) {
1456 $pageSelectCondition = $field .
'=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($this->
id,
'pages');
1457 $page =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'uid,hidden,starttime,endtime',
'pages', $pageSelectCondition .
' AND pid>=0 AND deleted=0');
1459 if ($workspace !== 0 && $workspace !== FALSE) {
1462 $pageSelectObject->versioningPreview = TRUE;
1463 $pageSelectObject->init(FALSE);
1464 $targetPage = $pageSelectObject->getWorkspaceVersionOfRecord($this->
whichWorkspace(),
'pages',
$page[
'uid']);
1465 $result = $targetPage === -1 || $targetPage === -2;
1483 $GLOBALS[
'TT']->push(
'fetch_the_id initialize/',
'');
1486 $this->sys_page->versioningPreview = $this->fePreview === 2 || (int)$this->workspacePreview || (
bool)
GeneralUtility::_GP(
'ADMCMD_view');
1487 $this->sys_page->versioningWorkspaceId = $this->
whichWorkspace();
1488 $this->sys_page->init($this->showHiddenPage);
1495 $idParts = explode(
'.', $this->
id, 2);
1496 $this->
id = $idParts[0];
1497 if (isset($idParts[1])) {
1498 $this->type = $idParts[1];
1504 $this->
id = (int)$this->
id;
1505 $this->type = (int)$this->type;
1508 $GLOBALS[
'TT']->push(
'fetch_the_id domain/',
'');
1510 $this->domainStartPage = $this->
findDomainRecord($this->TYPO3_CONF_VARS[
'SYS'][
'recursiveDomainSearch']);
1512 if ($this->domainStartPage) {
1517 $theFirstPage = $this->sys_page->getFirstWebPage($this->
id);
1518 if ($theFirstPage) {
1519 $this->
id = $theFirstPage[
'uid'];
1521 $message =
'No pages are found on the rootlevel!';
1526 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message, 1301648975);
1532 $GLOBALS[
'TT']->push(
'fetch_the_id rootLine/',
'');
1537 if ($this->pageNotFound && $this->TYPO3_CONF_VARS[
'FE'][
'pageNotFound_handling']) {
1538 $pNotFoundMsg = array(
1539 1 =>
'ID was not an accessible page',
1540 2 =>
'Subsection was found and not accessible',
1541 3 =>
'ID was outside the domain',
1542 4 =>
'The requested page alias does not exist' 1546 if ($this->page[
'url_scheme'] > 0) {
1554 if ($newUrl !==
'') {
1555 if ($_SERVER[
'REQUEST_METHOD'] ===
'POST') {
1564 if ($this->page[
'no_cache']) {
1565 $this->
set_no_cache(
'no_cache is set in page properties');
1568 $this->
register[
'SYS_LASTCHANGED'] = (int)$this->page[
'tstamp'];
1569 if ($this->
register[
'SYS_LASTCHANGED'] < (
int)$this->page[
'SYS_LASTCHANGED']) {
1570 $this->
register[
'SYS_LASTCHANGED'] = (int)$this->page[
'SYS_LASTCHANGED'];
1572 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'fetchPageId-PostProcessing'])) {
1573 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'fetchPageId-PostProcessing'] as $functionReference) {
1597 $this->page = $this->sys_page->getPage($this->
id);
1598 if (!count($this->page)) {
1601 $this->pageNotFound = 1;
1602 $this->rootLine = $this->sys_page->getRootLine($this->
id, $this->MP);
1603 if (count($this->rootLine)) {
1604 $c = count($this->rootLine) - 1;
1607 $this->pageAccessFailureHistory[
'direct_access'][] = $this->rootLine[$c];
1610 $this->
id = $this->rootLine[$c][
'uid'];
1611 $this->page = $this->sys_page->getPage($this->
id);
1612 if (count($this->page)) {
1618 if (!count($this->page)) {
1619 $message =
'The requested page does not exist!';
1620 if ($this->TYPO3_CONF_VARS[
'FE'][
'pageNotFound_handling']) {
1630 $message =
'The requested page does not exist!';
1631 if ($this->TYPO3_CONF_VARS[
'FE'][
'pageNotFound_handling']) {
1647 $this->page = $this->
getPageShortcut($this->page[
'shortcut'], $this->page[
'shortcut_mode'], $this->page[
'uid']);
1648 $this->
id = $this->page[
'uid'];
1655 $this->page = $this->sys_page->getPage($this->page[
'mount_pid']);
1656 if (empty($this->page)) {
1657 $message =
'This page (ID ' . $this->originalMountPointPage[
'uid'] .
') is of type "Mount point" and ' 1658 .
'mounts a page which is not accessible (ID ' . $this->originalMountPointPage[
'mount_pid'] .
').';
1661 $this->MP = $this->page[
'uid'] .
'-' . $this->originalMountPointPage[
'uid'];
1662 $this->
id = $this->page[
'uid'];
1665 $this->rootLine = $this->sys_page->getRootLine($this->
id, $this->MP);
1667 if (!count($this->rootLine)) {
1669 if ($this->sys_page->error_getRootLine_failPid == -1 && $ws) {
1670 $this->sys_page->versioningPreview = TRUE;
1671 $this->sys_page->versioningWorkspaceId = $ws;
1672 $this->rootLine = $this->sys_page->getRootLine($this->
id, $this->MP);
1674 if (!count($this->rootLine)) {
1675 $message =
'The requested page didn\'t have a proper connection to the tree-root!';
1679 $rootline =
'(' . $this->sys_page->error_getRootLine .
')';
1681 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message .
'<br /><br />' . $rootline, 1301648167);
1684 $this->fePreview = 1;
1688 if (!count($this->rootLine)) {
1689 $message =
'The requested page was not accessible!';
1694 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message, 1301648234);
1697 $el = reset($this->rootLine);
1698 $this->
id = $el[
'uid'];
1699 $this->page = $this->sys_page->getPage($this->
id);
1700 $this->rootLine = $this->sys_page->getRootLine($this->
id, $this->MP);
1721 public function getPageShortcut($SC, $mode, $thisUid, $itera = 20, $pageLog = array(), $disableGroupCheck = FALSE) {
1731 $randval = (int)rand(0, count($pageArray) - 1);
1735 foreach ($pageArray as $pV) {
1742 if (count(
$page) == 0) {
1743 $message =
'This page (ID ' . $thisUid .
') is of type "Shortcut" and configured to redirect to a subpage. ' .
'However, this page has no accessible subpages.';
1748 $parent = $this->sys_page->getPage($thisUid, $disableGroupCheck);
1749 $page = $this->sys_page->getPage($parent[
'pid'], $disableGroupCheck);
1751 if (count(
$page) == 0) {
1752 $message =
'This page (ID ' . $thisUid .
') is of type "Shortcut" and configured to redirect to its parent page. ' .
'However, the parent page is not accessible.';
1757 $page = $this->sys_page->getPage($idArray[0], $disableGroupCheck);
1758 if (count(
$page) == 0) {
1759 $message =
'This page (ID ' . $thisUid .
') is of type "Shortcut" and configured to redirect to a page, which is not accessible (ID ' . $idArray[0] .
').';
1765 if (!in_array(
$page[
'uid'], $pageLog) && $itera > 0) {
1766 $pageLog[] =
$page[
'uid'];
1769 $pageLog[] =
$page[
'uid'];
1770 $message =
'Page shortcuts were looping in uids ' . implode(
',', $pageLog) .
'...!';
1772 throw new \RuntimeException($message, 1294587212);
1787 $c = count($this->rootLine);
1788 $removeTheRestFlag = 0;
1789 for ($a = 0; $a < $c; $a++) {
1792 $this->pageAccessFailureHistory[
'sub_section'][] = $this->rootLine[$a];
1793 $removeTheRestFlag = 1;
1797 if ($this->beUserLogin) {
1798 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'uid',
'pages',
'uid=' . (
int)$this->
id .
' AND ' .
$GLOBALS[
'BE_USER']->getPagePermsClause(1));
1800 list($isPage) =
$GLOBALS[
'TYPO3_DB']->sql_fetch_row($res);
1803 $removeTheRestFlag = 1;
1807 $removeTheRestFlag = 1;
1810 if ($removeTheRestFlag) {
1812 $this->pageNotFound = 2;
1813 unset($this->rootLine[$a]);
1816 return $removeTheRestFlag;
1831 if (isset($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_checkEnableFields']) && is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_checkEnableFields'])) {
1832 $_params = array(
'pObj' => $this,
'row' => &$row,
'bypassGroupCheck' => &$bypassGroupCheck);
1833 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_checkEnableFields'] as $_funcRef) {
1836 if ($return === FALSE) {
1841 if ((!$row[
'hidden'] || $this->showHiddenPage) && $row[
'starttime'] <=
$GLOBALS[
'SIM_ACCESS_TIME'] && ($row[
'endtime'] == 0 || $row[
'endtime'] >
$GLOBALS[
'SIM_ACCESS_TIME']) && ($bypassGroupCheck || $this->
checkPageGroupAccess($row))) {
1856 if (is_null($groupList)) {
1859 if (!is_array($groupList)) {
1860 $groupList = explode(
',', $groupList);
1862 $pageGroupList = explode(
',', $row[
'fe_group'] ?: 0);
1863 return count(array_intersect($groupList, $pageGroupList)) > 0;
1887 $c = count($this->rootLine);
1890 for ($a = 0; $a < $c; $a++) {
1892 if ($this->rootLine[$a][
'fe_login_mode'] > 0) {
1894 if ((
int)$this->rootLine[$a][
'fe_login_mode'] === 1) {
1896 $this->loginAllowedInBranch_mode =
'all';
1897 } elseif ((
int)$this->rootLine[$a][
'fe_login_mode'] === 3) {
1899 $this->loginAllowedInBranch_mode =
'groups';
1916 $combinedRecords = array_merge(is_array($this->pageAccessFailureHistory[
'direct_access']) ? $this->pageAccessFailureHistory[
'direct_access'] : array(array(
'fe_group' => 0)), is_array($this->pageAccessFailureHistory[
'sub_section']) ? $this->pageAccessFailureHistory[
'sub_section'] : array());
1917 if (count($combinedRecords)) {
1918 foreach ($combinedRecords as $k => $pagerec) {
1921 if (!$k || $pagerec[
'extendToSubpages']) {
1922 if ($pagerec[
'hidden']) {
1923 $output[
'hidden'][$pagerec[
'uid']] = TRUE;
1925 if ($pagerec[
'starttime'] >
$GLOBALS[
'SIM_ACCESS_TIME']) {
1926 $output[
'starttime'][$pagerec[
'uid']] = $pagerec[
'starttime'];
1928 if ($pagerec[
'endtime'] != 0 && $pagerec[
'endtime'] <=
$GLOBALS[
'SIM_ACCESS_TIME']) {
1929 $output[
'endtime'][$pagerec[
'uid']] = $pagerec[
'endtime'];
1932 $output[
'fe_group'][$pagerec[
'uid']] = $pagerec[
'fe_group'];
1952 $theAlias = trim($theAlias);
1953 $this->
id = $theAlias !=
'' && strpos($theAlias,
'=') === FALSE ? $theAlias : 0;
1971 foreach ($this->rootLine as $key => $val) {
1979 $this->pageNotFound = 3;
1995 $this->sys_page->where_hid_del .=
' AND pages.doktype<200';
1996 $this->sys_page->where_groupAccess = $this->sys_page->getMultipleGroupsWhereClause(
'pages.fe_group',
'pages');
2010 while (count(
$host)) {
2032 $header = $header ?: $this->TYPO3_CONF_VARS[
'FE'][
'pageUnavailable_handling_statheader'];
2033 $this->
pageUnavailableHandler($this->TYPO3_CONF_VARS[
'FE'][
'pageUnavailable_handling'], $header, $reason);
2046 $header = $header ?: $this->TYPO3_CONF_VARS[
'FE'][
'pageNotFound_handling_statheader'];
2047 $this->
pageNotFoundHandler($this->TYPO3_CONF_VARS[
'FE'][
'pageNotFound_handling'], $header, $reason);
2060 $this->TYPO3_CONF_VARS[
'FE'][
'pageUnavailable_handling']
2063 $this->TYPO3_CONF_VARS[
'SYS'][
'devIPmask']
2066 $checkPageUnavailableHandler = TRUE;
2068 $checkPageUnavailableHandler = FALSE;
2070 return $checkPageUnavailableHandler;
2113 $headerArr = preg_split(
'/\\r|\\n/', $header, -1, PREG_SPLIT_NO_EMPTY);
2114 foreach ($headerArr as $header) {
2120 if (gettype($code) ==
'boolean' || (
string)$code ===
'1') {
2121 $title =
'Page Not Found';
2122 $message =
'The page did not exist or was inaccessible.' . ($reason ?
' Reason: ' . htmlspecialchars($reason) :
'');
2124 $messagePage->output();
2127 $funcRef = trim(substr($code, 14));
2130 'reasonText' => $reason,
2136 if (@is_file($readFile)) {
2139 '###CURRENT_URL###',
2144 htmlspecialchars($reason)
2149 throw new \RuntimeException(
'Configuration Error: 404 page "' . $readFile .
'" could not be found.', 1294587214);
2153 } elseif (strlen($code)) {
2155 $url_parts = parse_url($code);
2156 if ($url_parts[
'host'] ==
'') {
2158 if ($code[0] ===
'/') {
2163 $checkBaseTag = FALSE;
2165 $checkBaseTag = TRUE;
2169 if ($reason ==
'') {
2170 $reason =
'Page cannot be found.';
2172 $reason .= LF . LF .
'Additionally, ' . $code .
' was not found while trying to retrieve the error document.';
2173 throw new \RuntimeException(nl2br(htmlspecialchars($reason)), 1294587215);
2182 list($header,
$content) = explode(CRLF . CRLF, $res, 2);
2184 if (FALSE === $res) {
2189 $forwardHeaders = array(
2192 $headerArr = preg_split(
'/\\r|\\n/', $header, -1, PREG_SPLIT_NO_EMPTY);
2193 foreach ($headerArr as $header) {
2194 foreach ($forwardHeaders as $h) {
2195 if (preg_match(
'/^' . $h .
'/', $header)) {
2201 if ($checkBaseTag) {
2203 if (FALSE === stristr(
$content,
'<base ')) {
2205 $base = $url_parts[
'scheme'] .
'://';
2206 if ($url_parts[
'user'] !=
'') {
2207 $base .= $url_parts[
'user'];
2208 if ($url_parts[
'pass'] !=
'') {
2209 $base .=
':' . $url_parts[
'pass'];
2213 $base .= $url_parts[
'host'];
2215 $base .= preg_replace(
'/(.*\\/)[^\\/]*/',
'${1}', $url_parts[
'path']);
2217 $replacement = LF .
'<base href="' . htmlentities($base) .
'" />' . LF;
2221 $content = preg_replace(
'/(<html[^>]*>)/i',
'\\1<head>' . $replacement .
'</head>',
$content);
2229 $title =
'Page Not Found';
2230 $message = $reason ?
'Reason: ' . htmlspecialchars($reason) :
'Page cannot be found.';
2232 $messagePage->output();
2247 $aid = $this->sys_page->getPageIdFromAlias($this->
id);
2251 $this->pageNotFound = 4;
2264 if (is_array($GET_VARS)) {
2267 if (!is_array($realGet)) {
2275 if (isset($GET_VARS[
'type'])) {
2276 $this->type = (int)$GET_VARS[
'type'];
2278 if (isset($GET_VARS[
'cHash'])) {
2279 $this->cHash = $GET_VARS[
'cHash'];
2281 if (isset($GET_VARS[
'jumpurl'])) {
2282 $this->jumpurl = $GET_VARS[
'jumpurl'];
2284 if (isset($GET_VARS[
'MP'])) {
2285 $this->MP = $this->TYPO3_CONF_VARS[
'FE'][
'enable_mount_pids'] ? $GET_VARS[
'MP'] :
'';
2287 if (isset($GET_VARS[
'no_cache']) && $GET_VARS[
'no_cache']) {
2288 $this->
set_no_cache(
'no_cache is requested via GET parameter');
2309 if ($this->no_cache && !$this->TYPO3_CONF_VARS[
'FE'][
'pageNotFoundOnCHashError']) {
2313 if ($this->cHash && is_array($GET)) {
2317 $cHash_calc = $this->cacheHash->calculateCacheHash($this->cHash_array);
2318 if ($cHash_calc != $this->cHash) {
2319 if ($this->TYPO3_CONF_VARS[
'FE'][
'pageNotFoundOnCHashError']) {
2320 $this->
pageNotFoundAndExit(
'Request parameters could not be validated (&cHash comparison failed)');
2323 $GLOBALS[
'TT']->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);
2326 } elseif (is_array($GET)) {
2343 if (!$this->cHash) {
2344 if ($this->TYPO3_CONF_VARS[
'FE'][
'pageNotFoundOnCHashError']) {
2345 if ($this->tempContent) {
2351 $GLOBALS[
'TT']->setTSlogMessage(
'TSFE->reqCHash(): No &cHash parameter was sent for GET vars though required so caching is disabled', 2);
2363 $this->tmpl->init();
2364 $this->tmpl->tt_track = (bool)$this->beUserLogin;
2374 if (!$this->no_cache) {
2375 $cc = $this->tmpl->getCurrentPageData();
2376 if (!is_array($cc)) {
2382 $cc = $this->tmpl->getCurrentPageData();
2383 if (is_array($cc)) {
2389 if (is_array($cc)) {
2393 $cc = $this->tmpl->matching($cc);
2400 $this->content =
'';
2402 unset($this->config);
2403 $this->cacheContentFlag = FALSE;
2408 $this->newHash = $this->
getHash();
2409 $GLOBALS[
'TT']->push(
'Cache Row',
'');
2411 if (!is_array($row)) {
2416 if (is_array($row)) {
2422 if (is_array($row)) {
2426 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'pageLoadedFromCache'])) {
2427 $_params = array(
'pObj' => &$this,
'cache_pages_row' => &$row);
2428 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'pageLoadedFromCache'] as $_funcRef) {
2433 $this->config = $row[
'cache_data'];
2435 $this->content = $row[
'content'];
2437 $this->tempContent = $row[
'temp_content'];
2439 $this->cacheContentFlag = TRUE;
2440 $this->cacheExpires = $row[
'expires'];
2444 $this->page[
'title'] = $row[
'pageTitleInfo'][
'title'];
2445 $this->altPageTitle = $row[
'pageTitleInfo'][
'altPageTitle'];
2446 $this->indexedDocTitle = $row[
'pageTitleInfo'][
'indexedDocTitle'];
2448 if (isset($this->config[
'config'][
'debug'])) {
2449 $debugCacheTime = (bool)$this->config[
'config'][
'debug'];
2451 $debugCacheTime = !empty($this->TYPO3_CONF_VARS[
'FE'][
'debug']);
2453 if ($debugCacheTime) {
2454 $dateFormat =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'ddmmyy'];
2455 $timeFormat =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'hhmm'];
2456 $this->content .= LF .
'<!-- Cached page generated ' . date(($dateFormat .
' ' . $timeFormat), $row[
'tstamp']) .
'. Expires ' . Date(($dateFormat .
' ' . $timeFormat), $row[
'expires']) .
' -->';
2473 $GLOBALS[
'TT']->push(
'Cache Query',
'');
2474 $row = $this->pageCache->get($this->newHash);
2488 $disableAcquireCacheData = FALSE;
2489 if ($this->beUserLogin) {
2490 if (strtolower($_SERVER[
'HTTP_CACHE_CONTROL']) ===
'no-cache' || strtolower($_SERVER[
'HTTP_PRAGMA']) ===
'no-cache') {
2491 $disableAcquireCacheData = TRUE;
2495 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'headerNoCache'])) {
2496 $_params = array(
'pObj' => &$this,
'disableAcquireCacheData' => &$disableAcquireCacheData);
2497 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'headerNoCache'] as $_funcRef) {
2501 return $disableAcquireCacheData;
2529 return md5($lockHash);
2543 $hashParameters = array(
2544 'id' => (
int)$this->
id,
2545 'type' => (
int)$this->type,
2546 'gr_list' => (
string) $this->gr_list,
2547 'MP' => (
string) $this->MP,
2548 'cHash' => $this->cHash_array,
2549 'domainStartPage' => $this->domainStartPage
2552 if (!$createLockHashBase) {
2556 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'createHashBase'])) {
2558 'hashParameters' => &$hashParameters,
2559 'createLockHashBase' => $createLockHashBase
2561 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'createHashBase'] as $_funcRef) {
2565 return serialize($hashParameters);
2575 $setStatPageName = FALSE;
2577 if (!is_array($this->config) || is_array($this->config[
'INTincScript']) || $this->forceTemplateParsing) {
2578 $GLOBALS[
'TT']->push(
'Parse template',
'');
2582 $this->tmpl->start($this->rootLine);
2584 if ($this->tmpl->loaded) {
2585 $GLOBALS[
'TT']->push(
'Setting the config-array',
'');
2587 $this->sPre = $this->tmpl->setup[
'types.'][
$this->type];
2588 $this->pSetup = $this->tmpl->setup[$this->sPre .
'.'];
2589 if (!is_array($this->pSetup)) {
2590 $message =
'The page is not configured! [type=' . $this->type .
'][' . $this->sPre .
'].';
2594 $explanation =
'This means that there is no TypoScript object of type PAGE with typeNum=' . $this->type .
' configured.';
2596 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message .
' ' . $explanation, 1294587217);
2599 if (!isset($this->config[
'config'])) {
2600 $this->config[
'config'] = array();
2603 if (is_array($this->tmpl->setup[
'config.'])) {
2605 $this->config[
'config'] = $this->tmpl->setup[
'config.'];
2608 if (is_array($this->pSetup[
'config.'])) {
2611 if ($this->config[
'config'][
'typolinkEnableLinksAcrossDomains']) {
2612 $this->config[
'config'][
'typolinkCheckRootline'] = TRUE;
2616 if (!isset($this->config[
'config'][
'removeDefaultJS'])) {
2617 $this->config[
'config'][
'removeDefaultJS'] =
'external';
2619 if (!isset($this->config[
'config'][
'inlineStyle2TempFile'])) {
2620 $this->config[
'config'][
'inlineStyle2TempFile'] = 1;
2623 if (!isset($this->config[
'config'][
'compressJs'])) {
2624 $this->config[
'config'][
'compressJs'] = 0;
2627 $this->config[
'rootLine'] = $this->tmpl->rootLine;
2628 $this->config[
'mainScript'] = trim($this->config[
'config'][
'mainScript']) ?:
'index.php';
2631 if ($this->pSetup[
'pageHeaderFooterTemplateFile']) {
2632 $file = $this->tmpl->getFileName($this->pSetup[
'pageHeaderFooterTemplateFile']);
2643 $message =
'No TypoScript template found!';
2645 throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message, 1294587218);
2652 if ($this->config[
'config'][
'no_cache']) {
2656 if (!empty($this->config[
'config'][
'defaultGetVars.'])) {
2662 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'configArrayPostProc'])) {
2663 $params = array(
'config' => &$this->config[
'config']);
2664 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'configArrayPostProc'] as $funcRef) {
2711 if (!isset(
$GLOBALS[
'TCA'][
'pages'])) {
2724 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'settingLanguage_preProcess'])) {
2726 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'settingLanguage_preProcess'] as $_funcRef) {
2732 $this->initLLvars();
2735 $this->sys_language_uid = ($this->sys_language_content = (int)$this->config[
'config'][
'sys_language_uid']);
2737 $this->sys_language_contentOL = $this->config[
'config'][
'sys_language_overlay'];
2739 if ($this->sys_language_uid > 0) {
2745 $olRec = $this->sys_page->getPageOverlay($this->
id, $this->sys_language_uid);
2746 if (!count($olRec)) {
2748 if ($this->sys_language_uid) {
2753 switch ((
string) $this->sys_language_mode) {
2757 case 'content_fallback':
2759 foreach ($fallBackOrder as $orderValue) {
2760 if ((
string)$orderValue ===
'0' || count($this->sys_page->getPageOverlay($this->id, $orderValue))) {
2761 $this->sys_language_content = $orderValue;
2772 $this->sys_language_uid = ($this->sys_language_content = 0);
2778 $this->page = $this->sys_page->getPageOverlay($this->page, $this->sys_language_uid);
2785 $message =
'Page is not available in default language.';
2795 $sys_language_row = $this->sys_page->getRawRecord(
'sys_language', $this->sys_language_content,
'static_lang_isocode', TRUE);
2796 if (is_array($sys_language_row) && $sys_language_row[
'static_lang_isocode']) {
2797 $stLrow = $this->sys_page->getRawRecord(
'static_languages', $sys_language_row[
'static_lang_isocode'],
'lg_iso_2', TRUE);
2798 $this->sys_language_isocode = $stLrow[
'lg_iso_2'];
2803 foreach ($table_fields as $TF) {
2804 list($tN, $fN) = explode(
':', $TF);
2805 $GLOBALS[
'TCA'][$tN][
'columns'][$fN][
'l10n_mode'] =
'mergeIfNotBlank';
2809 foreach ($table_fields as $TF) {
2810 list($tN, $fN) = explode(
':', $TF);
2811 $GLOBALS[
'TCA'][$tN][
'columns'][$fN][
'l10n_mode'] =
'exclude';
2813 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'settingLanguage_postProcess'])) {
2815 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'settingLanguage_postProcess'] as $_funcRef) {
2825 if ($this->sys_language_uid) {
2826 $this->rootLine = $this->sys_page->getRootLine($this->
id, $this->MP);
2827 $this->tmpl->updateRootlineData($this->rootLine);
2838 if ($this->config[
'config'][
'locale_all']) {
2842 $locale = setlocale(LC_COLLATE, $this->config[
'config'][
'locale_all']);
2846 if (substr($this->config[
'config'][
'locale_all'], 0, 2) !=
'tr') {
2847 setlocale(LC_CTYPE, $this->config[
'config'][
'locale_all']);
2849 setlocale(LC_MONETARY, $this->config[
'config'][
'locale_all']);
2850 setlocale(LC_TIME, $this->config[
'config'][
'locale_all']);
2851 $this->localeCharset = $this->csConvObj->get_locale_charset($this->config[
'config'][
'locale_all']);
2853 $GLOBALS[
'TT']->setTSlogMessage(
'Locale "' . htmlspecialchars($this->config[
'config'][
'locale_all']) .
'" not found.', 3);
2868 if (!is_null($this->originalShortcutPage)) {
2869 $originalShortcutPageOverlay = $this->sys_page->getPageOverlay($this->originalShortcutPage[
'uid'], $this->sys_language_uid);
2870 if (!empty($originalShortcutPageOverlay[
'shortcut']) && $originalShortcutPageOverlay[
'shortcut'] != $this->
id) {
2873 $shortcut = $this->
getPageShortcut($originalShortcutPageOverlay[
'shortcut'], $originalShortcutPageOverlay[
'shortcut_mode'], $originalShortcutPageOverlay[
'uid']);
2874 $this->
id = ($this->contentPid = $shortcut[
'uid']);
2875 $this->page = $this->sys_page->getPage($this->
id);
2878 $this->tmpl->rootLine = array_reverse($this->rootLine);
2893 $this->sendFormmail();
2905 $formtype_mail = isset($_POST[
'formtype_mail']) || isset($_POST[
'formtype_mail_x']);
2906 if ($formtype_mail) {
2908 if (
GeneralUtility::getIndpEnv(
'TYPO3_HOST_ONLY') == $refInfo[
'host'] || $this->TYPO3_CONF_VARS[
'SYS'][
'doNotCheckReferer']) {
2910 if ($formtype_mail) {
2913 $GLOBALS[
'TT']->setTSlogMessage(
'"Check Data Submission": Return value: ' . $ret, 0);
2917 $GLOBALS[
'TT']->setTSlogMessage(
'"Check Data Submission": HTTP_HOST and REFERER HOST did not match when processing submitted formdata!', 3);
2921 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'checkDataSubmission'])) {
2922 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'checkDataSubmission'] as $_classRef) {
2924 $_procObj->checkDataSubmission($this);
2940 $locData = explode(
':', $locationData);
2941 if (!$locData[1] || $this->sys_page->checkRecord($locData[1], $locData[2], 1)) {
2943 if (count($this->sys_page->getPage($locData[0]))) {
2946 $GLOBALS[
'TT']->setTSlogMessage(
'LocationData Error: The page pointed to by location data (' . $locationData .
') was not accessible.', 2);
2949 $GLOBALS[
'TT']->setTSlogMessage(
'LocationData Error: Location data (' . $locationData .
') record pointed to was not accessible.', 2);
2959 protected function sendFormmail() {
2963 $locationData = $EMAIL_VARS[
'locationData'];
2964 unset($EMAIL_VARS[
'locationData']);
2965 unset($EMAIL_VARS[
'formtype_mail'], $EMAIL_VARS[
'formtype_mail_x'], $EMAIL_VARS[
'formtype_mail_y']);
2966 $integrityCheck = $this->TYPO3_CONF_VARS[
'FE'][
'strictFormmail'];
2967 if (!$this->TYPO3_CONF_VARS[
'FE'][
'secureFormmail']) {
2970 $encodedFields = explode(
',',
'recipient, recipient_copy');
2971 foreach ($encodedFields as $fieldKey) {
2972 if (strlen($EMAIL_VARS[$fieldKey])) {
2974 if ($res = $this->
codeString($EMAIL_VARS[$fieldKey], TRUE)) {
2975 $EMAIL_VARS[$fieldKey] = $res;
2976 } elseif ($integrityCheck) {
2978 $GLOBALS[
'TT']->setTSlogMessage(
'"Formmail" discovered a field (' . $fieldKey .
') which could not be decoded to a valid string. Sending formmail aborted due to security reasons!', 3);
2981 $GLOBALS[
'TT']->setTSlogMessage(
'"Formmail" discovered a field (' . $fieldKey .
') which could not be decoded to a valid string. The security level accepts this, but you should consider a correct coding though!', 2);
2986 $locData = explode(
':', $locationData);
2987 $record = $this->sys_page->checkRecord($locData[1], $locData[2], 1);
2988 $EMAIL_VARS[
'recipient'] = $record[
'subheader'];
2992 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'sendFormmail-PreProcClass'])) {
2993 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'sendFormmail-PreProcClass'] as $_classRef) {
2995 $EMAIL_VARS = $_procObj->sendFormmail_preProcessVariables($EMAIL_VARS, $this);
2998 $formmail->start($EMAIL_VARS);
2999 $formmail->sendtheMail();
3000 $GLOBALS[
'TT']->setTSlogMessage(
'"Formmail" invoked, sending mail to ' . $EMAIL_VARS[
'recipient'], 0);
3011 $recipient_copy =
'';
3014 preg_match(
'/^[\\s]*\\|[\\s]*recipient_copy[\\s]*=[\\s]*hidden[\\s]*\\|(.*)$/m', $bodytext, $fdef);
3015 $recipient_copy = $fdef[1] ?:
'';
3016 return $recipient_copy;
3025 if ($extUrl = $this->sys_page->getExtURL($this->page, $this->config[
'config'][
'disablePageExternalUrl'])) {
3026 $this->jumpurl = $extUrl;
3037 if (strlen($this->jumpurl) && !$this->TYPO3_CONF_VARS[
'SYS'][
'doNotCheckReferer']) {
3040 unset($this->jumpurl);
3055 if ($this->jumpurl) {
3067 if ($juHash === $calcJuHash) {
3070 $this->jumpurl = rawurldecode($this->jumpurl);
3074 if (@is_file($absoluteFileName)) {
3075 $mimeType = $mimeType ?:
'application/octet-stream';
3076 header(
'Cache-Control: must-revalidate, post-check=0, pre-check=0');
3077 header(
'Content-Type: ' . $mimeType);
3078 header(
'Content-Disposition: attachment; filename="' . basename($absoluteFileName) .
'"');
3079 header(
'Content-Length: ' . filesize($absoluteFileName));
3081 readfile($absoluteFileName);
3084 throw new \Exception(
'jumpurl Secure: "' . $this->jumpurl .
'" was not a valid file!', 1294585193);
3087 throw new \Exception(
'jumpurl Secure: The requested file was not allowed to be accessed through jumpUrl (path or file not allowed)!', 1294585194);
3090 throw new \Exception(
'jumpurl Secure: locationData, ' . $locationData .
', was not accessible.', 1294585195);
3093 throw new \Exception(
'jumpurl Secure: Calculated juHash did not match the submitted juHash.', 1294585196);
3096 $allowRedirect = FALSE;
3098 $allowRedirect = TRUE;
3099 } elseif (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'jumpurlRedirectHandler'])) {
3100 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'jumpurlRedirectHandler'] as $classReference) {
3102 $allowRedirectFromHook = FALSE;
3103 if (method_exists($hookObject,
'jumpurlRedirectHandler')) {
3104 $allowRedirectFromHook = $hookObject->jumpurlRedirectHandler($this->jumpurl, $this);
3106 if ($allowRedirectFromHook === TRUE) {
3107 $allowRedirect = TRUE;
3112 if ($allowRedirect) {
3114 if ($TSConf[
'TSFE.'][
'jumpUrl_transferSession']) {
3115 $uParts = parse_url($this->jumpurl);
3116 $params =
'&FE_SESSION_KEY=' . rawurlencode(($this->fe_user->id .
'-' . md5(($this->fe_user->id .
'/' . $this->TYPO3_CONF_VARS[
'SYS'][
'encryptionKey']))));
3118 $this->jumpurl .= ($uParts[
'query'] ?
'' :
'?') . $params;
3121 if ($TSConf[
'TSFE.'][
'jumpURL_HTTPStatusCode']) {
3122 switch ((
int)$TSConf[
'TSFE.'][
'jumpURL_HTTPStatusCode']) {
3136 throw new \Exception(
'jumpurl: Calculated juHash did not match the submitted juHash.', 1359987599);
3150 if ($this->config[
'config'][
'ftu']) {
3151 $this->getMethodUrlIdToken = $this->TYPO3_CONF_VARS[
'FE'][
'get_url_id_token'];
3153 $this->getMethodUrlIdToken =
'';
3164 $this->linkVars =
'';
3171 $test = ($value =
'');
3172 if (preg_match(
'/^(.*)\\((.+)\\)$/', $linkVar, $match)) {
3173 $linkVar = trim($match[1]);
3174 $test = trim($match[2]);
3176 if ($linkVar ===
'' || !isset($getData[$linkVar])) {
3179 if (!is_array($getData[$linkVar])) {
3180 $temp = rawurlencode($getData[$linkVar]);
3181 if ($test !==
'' && !\
TYPO3\CMS\Frontend\Page\PageGenerator::isAllowedLinkVarValue($temp, $test)) {
3185 $value =
'&' . $linkVar .
'=' . $temp;
3187 if ($test !==
'' && $test !==
'array') {
3193 $this->linkVars .= $value;
3207 $this->redirectToCurrentPage();
3221 $this->redirectToCurrentPage();
3231 protected function redirectToCurrentPage() {
3236 $parameter = $this->page[
'uid'];
3239 $parameter .=
',' .
$type;
3241 $redirectUrl =
$cObj->typoLink_URL(array(
'parameter' => $parameter));
3244 if (!empty($redirectUrl)) {
3273 $this->tempContent = FALSE;
3274 if (!$this->no_cache) {
3276 $title = htmlspecialchars($this->tmpl->printTitle($this->page[
'title']));
3279 <strong>Page is being generated.</strong><br /> 3280 If this message does not disappear within ' . $seconds .
' seconds, please reload.';
3281 $message = $this->config[
'config'][
'message_page_is_being_generated'];
3282 if ((
string)$message !==
'') {
3284 $message = $this->csConvObj->utf8_encode($message, $this->renderCharset);
3285 $message = str_replace(
'###TITLE###', $title, $message);
3286 $message = str_replace(
'###REQUEST_URI###', $request_uri, $message);
3290 $temp_content =
'<?xml version="1.0" encoding="UTF-8"?> 3291 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3292 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3293 <html xmlns="http://www.w3.org/1999/xhtml"> 3295 <title>' . $title .
'</title> 3296 <meta http-equiv="refresh" content="10" /> 3298 <body style="background-color:white; font-family:Verdana,Arial,Helvetica,sans-serif; color:#cccccc; text-align:center;">' . $message .
' 3302 $padSuffix =
'<!--pad-->';
3304 $padSize = 768 - strlen($padSuffix) - strlen($temp_content);
3306 $temp_content = str_pad($temp_content, $padSize, LF) . $padSuffix;
3313 $this->
set_no_cache(
'Another process wrote into the cache since the beginning of the render process', TRUE);
3315 $this->tempContent = TRUE;
3330 $cacheTimeout = $this->get_cache_timeout();
3331 $timeOutTime =
$GLOBALS[
'EXEC_TIME'] + $cacheTimeout;
3332 $this->tempContent = FALSE;
3333 $usePageCache = TRUE;
3337 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'usePageCache'])) {
3338 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'usePageCache'] as $_classRef) {
3340 $usePageCache = $_procObj->usePageCache($this, $usePageCache);
3344 if ($usePageCache) {
3348 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'insertPageIncache'])) {
3349 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'insertPageIncache'] as $_classRef) {
3351 $_procObj->insertPageIncache($this, $timeOutTime);
3368 'identifier' => $this->newHash,
3369 'page_id' => $this->
id,
3371 'temp_content' => $this->tempContent,
3372 'cache_data' => $data,
3373 'expires' => $expirationTstamp,
3375 'pageTitleInfo' => array(
3376 'title' => $this->page[
'title'],
3377 'altPageTitle' => $this->altPageTitle,
3378 'indexedDocTitle' => $this->indexedDocTitle
3381 $this->cacheExpires = $expirationTstamp;
3382 $this->pageCacheTags[] =
'pageId_' . $cacheData[
'page_id'];
3383 if ($this->page_cache_reg1) {
3384 $reg1 = (int)$this->page_cache_reg1;
3385 $cacheData[
'reg1'] = $reg1;
3386 $this->pageCacheTags[] =
'reg1_' . $reg1;
3388 if (!empty($this->page[
'cache_tags'])) {
3390 $this->pageCacheTags = array_merge($this->pageCacheTags, $tags);
3392 $this->pageCache->set($this->newHash, $cacheData, $this->pageCacheTags, $expirationTstamp -
$GLOBALS[
'EXEC_TIME']);
3402 $this->pageCache->remove($this->newHash);
3414 foreach ($pageIds as $pageId) {
3415 $this->pageCache->flushByTag(
'pageId_' . (
int)$pageId);
3428 if ($this->page[
'SYS_LASTCHANGED'] < (
int)$this->
register[
'SYS_LASTCHANGED']) {
3429 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'pages',
'uid=' . (
int)$this->
id, array(
'SYS_LASTCHANGED' => (
int)$this->
register[
'SYS_LASTCHANGED']));
3450 if (!is_object($lockObj)) {
3457 $success = $lockObj->acquire();
3458 if ($lockObj->getLockStatus()) {
3459 $lockObj->sysLog(
'Acquired lock');
3481 if (is_object($lockObj) && $lockObj instanceof \
TYPO3\CMS\Core\Locking\Locker && $lockObj->getLockStatus()) {
3482 $success = $lockObj->release();
3483 $lockObj->sysLog(
'Released lock');
3499 $this->pageCacheTags = array_merge($this->pageCacheTags, $tags);
3515 $this->newHash = $this->
getHash();
3516 if (!is_object($this->pages_lockObj) || $this->pages_lockObj->getLockStatus() == FALSE) {
3521 $this->cacheTimeOutDefault = (int)$this->config[
'config'][
'cache_period'];
3533 if (!$this->TYPO3_CONF_VARS[
'FE'][
'noPHPscriptInclude'] && $this->config[
'config'][
'pageGenScript']) {
3534 return $this->tmpl->getFileName($this->config[
'config'][
'pageGenScript']);
3546 if ($this->no_cacheBeforePageGen) {
3547 $this->
set_no_cache(
'no_cache has been set before the page was generated - safety check', TRUE);
3551 $GLOBALS[
'TT']->push(
'XHTML clean, all',
'');
3553 $this->content = $XHTML_clean->XHTML_clean($this->content);
3558 $GLOBALS[
'TT']->push(
'Local anchor fix, all',
'');
3563 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'contentPostProc-all'])) {
3564 $_params = array(
'pObj' => &$this);
3565 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'contentPostProc-all'] as $_funcRef) {
3570 if (!$this->no_cache) {
3573 $GLOBALS[
'TT']->push(
'XHTML clean, cached',
'');
3575 $this->content = $XHTML_clean->XHTML_clean($this->content);
3580 $GLOBALS[
'TT']->push(
'Local anchor fix, cached',
'');
3585 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'contentPostProc-cached'])) {
3586 $_params = array(
'pObj' => &$this);
3587 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'contentPostProc-cached'] as $_funcRef) {
3595 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'pageIndexing'])) {
3596 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'pageIndexing'] as $_classRef) {
3598 $_procObj->hook_indexContent($this);
3602 if (!$this->no_cache) {
3604 } elseif ($this->tempContent) {
3607 $this->tempContent = FALSE;
3630 public function INTincScript() {
3633 $this->additionalHeaderData = is_array($this->config[
'INTincScript_ext'][
'additionalHeaderData']) ? $this->config[
'INTincScript_ext'][
'additionalHeaderData'] : array();
3634 $this->additionalFooterData = is_array($this->config[
'INTincScript_ext'][
'additionalFooterData']) ? $this->config[
'INTincScript_ext'][
'additionalFooterData'] : array();
3635 $this->additionalJavaScript = $this->config[
'INTincScript_ext'][
'additionalJavaScript'];
3636 $this->additionalCSS = $this->config[
'INTincScript_ext'][
'additionalCSS'];
3637 $this->JSImgCode = $this->additionalHeaderData[
'JSImgCode'];
3638 $this->divSection =
'';
3639 if (!empty($this->config[
'INTincScript_ext'][
'pageRenderer'])) {
3641 $pageRenderer = unserialize($this->config[
'INTincScript_ext'][
'pageRenderer']);
3647 $GLOBALS[
'TT']->push(
'Substitute header section');
3651 $this->content = str_replace(
3653 '<!--HD_' . $this->config[
'INTincScript_ext'][
'divKey'] .
'-->',
3654 '<!--FD_' . $this->config[
'INTincScript_ext'][
'divKey'] .
'-->',
3655 '<!--TDS_' . $this->config[
'INTincScript_ext'][
'divKey'] .
'-->' 3662 $this->
getPageRenderer()->renderJavaScriptAndCssForProcessingOfUncachedContentObjects($this->content, $this->config[
'INTincScript_ext'][
'divKey'])
3666 $this->setAbsRefPrefix();
3677 $INTiS_config = $this->config[
'INTincScript'];
3681 $INTiS_config = array_diff_assoc($this->config[
'INTincScript'], $INTiS_config);
3682 $reprocess = count($INTiS_config) > 0;
3683 }
while ($reprocess);
3694 foreach ($INTiS_config as $INTiS_cPart) {
3695 if (isset($INTiS_cPart[
'conf'][
'includeLibs']) && $INTiS_cPart[
'conf'][
'includeLibs']) {
3710 $GLOBALS[
'TT']->push(
'Split content');
3712 $INTiS_splitC = explode(
'<!--INT_SCRIPT.', $this->content);
3713 $this->content =
'';
3714 $GLOBALS[
'TT']->setTSlogMessage(
'Parts: ' . count($INTiS_splitC));
3716 foreach ($INTiS_splitC as $INTiS_c => $INTiS_cPart) {
3718 if (substr($INTiS_cPart, 32, 3) ===
'-->') {
3719 $INTiS_key =
'INT_SCRIPT.' . substr($INTiS_cPart, 0, 32);
3720 if (is_array($INTiS_config[$INTiS_key])) {
3721 $GLOBALS[
'TT']->push(
'Include ' . $INTiS_config[$INTiS_key][
'file'],
'');
3723 $INTiS_cObj = unserialize($INTiS_config[$INTiS_key][
'cObj']);
3725 $INTiS_cObj->INT_include = 1;
3726 switch ($INTiS_config[$INTiS_key][
'type']) {
3728 $incContent = $INTiS_cObj->COBJ_ARRAY($INTiS_config[$INTiS_key][
'conf']);
3731 $incContent = $INTiS_cObj->USER($INTiS_config[$INTiS_key][
'conf']);
3733 case 'POSTUSERFUNC':
3734 $incContent = $INTiS_cObj->callUserFunction($INTiS_config[$INTiS_key][
'postUserFunc'], $INTiS_config[$INTiS_key][
'conf'], $INTiS_config[$INTiS_key][
'content']);
3738 $this->content .= substr($INTiS_cPart, 35);
3741 $this->content .= substr($INTiS_cPart, 35);
3744 $this->content .= ($INTiS_c ?
'<!--INT_SCRIPT.' :
'') . $INTiS_cPart;
3757 $jsImgCode = trim($this->JSImgCode);
3758 if ($jsImgCode !==
'') {
3759 $this->additionalHeaderData[
'JSImgCode'] =
' 3760 <script type="text/javascript"> 3763 if (version == "n3") { 3771 $jsCode = trim($this->JSCode);
3773 ? implode(LF, $this->additionalJavaScript)
3777 $this->additionalHeaderData[
'JSCode'] =
' 3778 <script type="text/javascript"> 3788 $additionalCss = is_array($this->additionalCSS) ? implode(LF, $this->additionalCSS) :
$this->additionalCSS;
3789 $additionalCss = trim($additionalCss);
3790 if ($additionalCss !==
'') {
3791 $this->additionalHeaderData[
'_CSS'] =
' 3792 <style type="text/css"> 3793 ' . $additionalCss .
' 3804 return is_array($this->config[
'INTincScript']) && !
$this->jumpurl;
3814 return $this->config[
'config'][
'xhtml_cleaning'];
3824 return isset($this->config[
'config'][
'prefixLocalAnchors']) ? $this->config[
'config'][
'prefixLocalAnchors'] : NULL;
3842 if (isset($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'isOutputting']) && is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'isOutputting'])) {
3843 $_params = array(
'pObj' => &$this,
'enableOutput' => &$enableOutput);
3844 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'isOutputting'] as $_funcRef) {
3848 return $enableOutput;
3860 if (empty($this->config[
'config'][
'disableCharsetHeader'])) {
3861 $headLine =
'Content-Type: text/html; charset=' . trim($this->metaCharset);
3865 if (!empty($this->config[
'config'][
'sendCacheHeaders'])) {
3869 if (!empty($this->config[
'config'][
'additionalHeaders'])) {
3870 $headerArray = explode(
'|', $this->config[
'config'][
'additionalHeaders']);
3871 foreach ($headerArray as $headLine) {
3872 $headLine = trim($headLine);
3877 if ($this->tempContent) {
3881 if (!$this->isClientCachable) {
3886 $GLOBALS[
'TT']->push(
'XHTML clean, output',
'');
3888 $this->content = $XHTML_clean->XHTML_clean($this->content);
3893 $GLOBALS[
'TT']->push(
'Local anchor fix, output',
'');
3898 if (isset($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'contentPostProc-output']) && is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'contentPostProc-output'])) {
3899 $_params = array(
'pObj' => &$this);
3900 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'contentPostProc-output'] as $_funcRef) {
3909 (!isset($this->config[
'config'][
'enableContentLengthHeader']) || $this->config[
'config'][
'enableContentLengthHeader'])
3910 && !$this->beUserLogin && !$this->TYPO3_CONF_VARS[
'FE'][
'debug']
3913 header(
'Content-Length: ' . strlen($this->content));
3929 $loginsDeniedCfg = empty($this->config[
'config'][
'sendCacheHeaders_onlyWhenLoginDeniedInBranch']) || empty($this->loginAllowedInBranch);
3931 if ($doCache && !$this->beUserLogin && !$this->
doWorkspacePreview() && $loginsDeniedCfg) {
3934 'Expires: ' . gmdate(
'D, d M Y H:i:s T', $this->cacheExpires),
3935 'ETag: "' . md5($this->content) .
'"',
3936 'Cache-Control: max-age=' . ($this->cacheExpires -
$GLOBALS[
'EXEC_TIME']),
3940 $this->isClientCachable = TRUE;
3944 'Cache-Control: private' 3946 $this->isClientCachable = FALSE;
3948 if ($this->beUserLogin) {
3950 $GLOBALS[
'TT']->setTSlogMessage(
'Cache-headers with max-age "' . ($this->cacheExpires -
$GLOBALS[
'EXEC_TIME']) .
'" would have been sent');
3953 $reasonMsg .= !$this->no_cache ?
'' :
'Caching disabled (no_cache). ';
3954 $reasonMsg .= !$this->
isINTincScript() ?
'' :
'*_INT object(s) on page. ';
3955 $reasonMsg .= !is_array($this->fe_user->user) ?
'' :
'Frontend user logged in. ';
3956 $GLOBALS[
'TT']->setTSlogMessage(
'Cache-headers would disable proxy caching! Reason(s): "' . $reasonMsg .
'"', 1);
3961 foreach ($headers as $hL) {
3992 if (!empty($this->fe_user->user[
'uid'])) {
3994 $token = isset($this->config[
'config'][
'USERNAME_substToken']) ? trim($this->config[
'config'][
'USERNAME_substToken']) :
'';
3995 $search[] = $token ? $token :
'<!--###USERNAME###-->';
3996 $replace[] = $this->fe_user->user[
'username'];
3998 $token = isset($this->config[
'config'][
'USERUID_substToken']) ? trim($this->config[
'config'][
'USERUID_substToken']) :
'';
4001 $replace[] = $this->fe_user->user[
'uid'];
4005 if ($this->getMethodUrlIdToken) {
4007 $replace[] = $this->fe_user->get_URL_ID;
4010 if (isset($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'tslib_fe-contentStrReplace'])) {
4011 $contentStrReplaceHooks = &$this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'tslib_fe-contentStrReplace'];
4012 if (is_array($contentStrReplaceHooks)) {
4014 'search' => &$search,
4015 'replace' => &$replace
4017 foreach ($contentStrReplaceHooks as $_funcRef) {
4022 if (count($search)) {
4023 $this->content = str_replace($search, $replace, $this->content);
4033 $this->fe_user->storeSessionData();
4044 $microtime_start = isset(
$GLOBALS[
'TYPO3_MISC'][
'microtime_start']) ?
$GLOBALS[
'TYPO3_MISC'][
'microtime_start'] : NULL;
4045 $microtime_end = isset(
$GLOBALS[
'TYPO3_MISC'][
'microtime_end']) ?
$GLOBALS[
'TYPO3_MISC'][
'microtime_end'] : NULL;
4046 $microtime_BE_USER_start = isset(
$GLOBALS[
'TYPO3_MISC'][
'microtime_BE_USER_start']) ?
$GLOBALS[
'TYPO3_MISC'][
'microtime_BE_USER_start'] : NULL;
4047 $microtime_BE_USER_end = isset(
$GLOBALS[
'TYPO3_MISC'][
'microtime_BE_USER_end']) ?
$GLOBALS[
'TYPO3_MISC'][
'microtime_BE_USER_end'] : NULL;
4048 $this->scriptParseTime =
$GLOBALS[
'TT']->getMilliseconds($microtime_end) -
$GLOBALS[
'TT']->getMilliseconds($microtime_start) - (
$GLOBALS[
'TT']->getMilliseconds($microtime_BE_USER_end) -
$GLOBALS[
'TT']->getMilliseconds($microtime_BE_USER_start));
4057 if ($this->fePreview !== 0) {
4059 if (isset($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_previewInfo']) && is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_previewInfo'])) {
4060 $_params = array(
'pObj' => &$this);
4061 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_previewInfo'] as $_funcRef) {
4065 $this->content = str_ireplace(
'</body>', $previewInfo .
'</body>', $this->content);
4076 if (isset($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_eofe']) && is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_eofe'])) {
4077 $_params = array(
'pObj' => &$this);
4078 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'hook_eofe'] as $_funcRef) {
4090 if (!empty($this->config[
'config'][
'beLoginLinkIPList'])) {
4092 $label = !$this->beUserLogin ? $this->config[
'config'][
'beLoginLinkIPList_login'] : $this->config[
'config'][
'beLoginLinkIPList_logout'];
4094 if (!$this->beUserLogin) {
4095 $link =
'<a href="' . htmlspecialchars((TYPO3_mainDir .
'index.php?redirect_url=' . rawurlencode(
GeneralUtility::getIndpEnv(
'REQUEST_URI')))) .
'">' . $label .
'</a>';
4097 $link =
'<a href="' . htmlspecialchars((TYPO3_mainDir .
'index.php?L=OUT&redirect_url=' . rawurlencode(
GeneralUtility::getIndpEnv(
'REQUEST_URI')))) .
'">' . $label .
'</a>';
4112 header(
'HTTP/1.0 503 Service unavailable');
4113 header(
'Retry-after: 3600');
4114 header(
'Pragma: no-cache');
4115 header(
'Cache-control: no-cache');
4116 header(
'Expire: 0');
4137 if ($offset > 0 && $n > $end) {
4138 $n = $start + ($n - $end - 1);
4139 } elseif ($offset < 0 && $n < $start) {
4140 $n = $end - ($start - $n - 1);
4155 if ($this->spamProtectEmailAddresses ===
'ascii') {
4156 $stringLength = strlen($string);
4157 for ($a = 0; $a < $stringLength; $a++) {
4158 $out .=
'&#' . ord(substr($string, $a, 1)) .
';';
4162 $len = strlen($string);
4163 $offset = (int)$this->spamProtectEmailAddresses * ($back ? -1 : 1);
4164 for ($i = 0; $i < $len; $i++) {
4165 $charValue = ord($string[$i]);
4167 if ($charValue >= 43 && $charValue <= 58) {
4169 } elseif ($charValue >= 64 && $charValue <= 90) {
4172 } elseif ($charValue >= 97 && $charValue <= 122) {
4176 $out .= $string[$i];
4195 list($md5Hash, $str) = explode(
':', $string, 2);
4196 $newHash = substr(md5($this->TYPO3_CONF_VARS[
'SYS'][
'encryptionKey'] .
':' . $str), 0, 10);
4198 $str = base64_decode($str);
4207 $str = base64_encode($str);
4208 $newHash = substr(md5($this->TYPO3_CONF_VARS[
'SYS'][
'encryptionKey'] .
':' . $str), 0, 10);
4226 $cleartextLength = strlen($string);
4227 $key = sha1($this->TYPO3_CONF_VARS[
'SYS'][
'encryptionKey']);
4228 $keyLength = strlen($key);
4229 for ($a = 0; $a < $cleartextLength; $a++) {
4230 $xorVal = ord($key[$a % $keyLength]);
4231 $out .= chr(ord($string[$a]) ^ $xorVal);
4245 return !$this->TYPO3_CONF_VARS[
'FE'][
'noPHPscriptInclude'] || substr($incFile, 0, 4 + strlen(TYPO3_mainDir)) == TYPO3_mainDir .
'ext/' || substr($incFile, 0, 7 + strlen(TYPO3_mainDir)) == TYPO3_mainDir .
'sysext/' || substr($incFile, 0, 14) ==
'typo3conf/ext/';
4257 $this->cObj->start($this->page,
'pages');
4267 public function setAbsRefPrefix() {
4268 if (!$this->absRefPrefix) {
4274 '"' . TYPO3_mainDir .
'contrib/',
4275 '"' . TYPO3_mainDir .
'ext/',
4276 '"' . TYPO3_mainDir .
'sysext/',
4277 '"' .
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'RTE_imageStorageDir']
4280 '"' . $this->absRefPrefix .
'typo3temp/',
4281 '"' . $this->absRefPrefix .
'typo3conf/ext/',
4282 '"' . $this->absRefPrefix . TYPO3_mainDir .
'contrib/',
4283 '"' . $this->absRefPrefix . TYPO3_mainDir .
'ext/',
4284 '"' . $this->absRefPrefix . TYPO3_mainDir .
'sysext/',
4285 '"' . $this->absRefPrefix .
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'RTE_imageStorageDir']
4289 $storages = $storageRepository->findAll();
4290 foreach ($storages as $storage) {
4291 if ($storage->getDriverType() ===
'Local' && $storage->isPublic() && $storage->isOnline()) {
4292 $folder = $storage->getPublicUrl($storage->getRootLevelFolder(), TRUE);
4293 $search[] =
'"' . $folder;
4294 $replace[] =
'"' . $this->absRefPrefix . $folder;
4299 foreach ($directories as $directory) {
4300 $search[] =
'"' . $directory;
4301 $replace[] =
'"' . $this->absRefPrefix . $directory;
4303 $this->content = str_replace(
4319 if ($this->baseUrl) {
4320 $urlParts = parse_url($url);
4321 if (!strlen($urlParts[
'scheme']) && $url[0] !==
'/') {
4322 $url = $this->baseUrl . $url;
4340 $explanationText = strlen($explanation) ?
' - ' . $explanation :
'';
4341 $GLOBALS[
'TT']->setTSlogMessage($typoScriptProperty .
' is deprecated.' . $explanationText, 2);
4354 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'cache_md5params',
'md5hash=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($hash,
'cache_md5params'), array(
'tstamp' =>
$GLOBALS[
'EXEC_TIME']));
4370 if ($this->TYPO3_CONF_VARS[
'FE'][
'tidy'] && $this->TYPO3_CONF_VARS[
'FE'][
'tidy_path']) {
4377 $fp = fopen($fname,
'wb');
4383 exec($this->TYPO3_CONF_VARS[
'FE'][
'tidy_path'] .
' ' . $fname, $output);
4390 $GLOBALS[
'TT']->setTSlogMessage(
'"tidy" returned an empty value!', 2);
4392 $GLOBALS[
'TT']->setTSlogMessage(
'"tidy" content length: ' . strlen(
$content), 0);
4404 if (!$this->beUserLogin) {
4405 if (!is_object($this->cObj)) {
4408 $scriptPath = $this->cObj->getUrlToCurrentLocation();
4416 $this->content = preg_replace(
'/(<(?:a|area).*?href=")(#[^"]*")/i',
'${1}' . htmlspecialchars($scriptPath) .
'${2}', $originalContent);
4418 if (preg_last_error() > 0) {
4419 GeneralUtility::sysLog(
'preg_replace returned error-code: ' . preg_last_error() .
' in function prefixLocalAnchorsWithScript. Replacement not done!',
'cms',
GeneralUtility::SYSLOG_SEVERITY_FATAL);
4420 $this->content = $originalContent;
4434 return $this->workspacePreview !== 0;
4446 $ws = (int)$this->workspacePreview;
4447 } elseif ($this->beUserLogin) {
4448 $ws =
$GLOBALS[
'BE_USER']->workspace;
4454 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'title',
'sys_workspace',
'uid=' . (
int)$ws);
4455 if ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
4456 return $row[
'title'];
4472 $GLOBALS[
'TT']->push(
'Include libraries');
4473 $GLOBALS[
'TT']->setTSlogMessage(
'Files for inclusion: "' . implode(
', ', $libraries) .
'"');
4474 foreach ($libraries as $library) {
4475 $file =
$GLOBALS[
'TSFE']->tmpl->getFileName($library);
4477 include_once
'./' . $file;
4479 $GLOBALS[
'TT']->setTSlogMessage(
'Include file "' . $file .
'" did not exist!', 2);
4498 if (!is_array($this->rootLine)) {
4501 foreach ($this->rootLine as $rC) {
4502 if (!$res[
'_STORAGE_PID']) {
4503 $res[
'_STORAGE_PID'] = (int)$rC[
'storage_pid'];
4505 if (!$res[
'_SITEROOT']) {
4506 $res[
'_SITEROOT'] = $rC[
'is_siteroot'] ? (int)$rC[
'uid'] : 0;
4519 if (!is_array($this->pagesTSconfig)) {
4520 $TSdataArray = array();
4522 $TSdataArray[] = $this->TYPO3_CONF_VARS[
'BE'][
'defaultPageTSconfig'];
4523 foreach ($this->rootLine as $k => $v) {
4524 $TSdataArray[] = $v[
'TSconfig'];
4528 $userTS = implode(LF .
'[GLOBAL]' . LF, $TSdataArray);
4529 $hash = md5(
'pageTS:' . $userTS);
4530 $cachedContent = $this->sys_page->getHash($hash);
4531 if (is_array($cachedContent)) {
4532 $this->pagesTSconfig = $cachedContent;
4535 $parseObj->parse($userTS);
4536 $this->pagesTSconfig = $parseObj->setup;
4537 $this->sys_page->storeHash($hash, $this->pagesTSconfig,
'PAGES_TSconfig');
4556 $this->additionalJavaScript[$key] =
' // JS function for mouse-over 4557 function over(name, imgObj) { // 4558 if (version == "n3" && document[name]) {document[name].src = eval(name+"_h.src");} 4559 else if (document.getElementById && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_h.src");} 4560 else if (imgObj) {imgObj.src = eval(name+"_h.src");} 4562 // JS function for mouse-out 4563 function out(name, imgObj) { // 4564 if (version == "n3" && document[name]) {document[name].src = eval(name+"_n.src");} 4565 else if (document.getElementById && document.getElementById(name)) {document.getElementById(name).src = eval(name+"_n.src");} 4566 else if (imgObj) {imgObj.src = eval(name+"_n.src");} 4570 $this->additionalJavaScript[$key] =
' function openPic(url, winName, winParams) { // 4571 var theWindow = window.open(url, winName, winParams); 4572 if (theWindow) {theWindow.focus();} 4576 $this->additionalJavaScript[$key] =
$content;
4592 $this->additionalCSS[$key] =
$content;
4605 return md5($this->uniqueString .
'_' . $str . $this->uniqueCounter++);
4617 if ($internal && isset(
$GLOBALS[
'BE_USER'])) {
4623 if (strlen($reason)) {
4624 $warning =
'$TSFE->set_no_cache() was triggered. Reason: ' . $reason .
'.';
4626 $trace = debug_backtrace();
4628 $PATH_site_real = dirname(realpath(PATH_site .
'typo3')) .
'/';
4629 $file = $trace[0][
'file'];
4631 $file = str_replace($PATH_site_real,
'', $file);
4633 $file = str_replace(PATH_site,
'', $file);
4635 $line = $trace[0][
'line'];
4636 $trigger = $file .
' on line ' . $line;
4637 $warning =
'$GLOBALS[\'TSFE\']->set_no_cache() was triggered by ' . $trigger .
'.';
4639 if ($this->TYPO3_CONF_VARS[
'FE'][
'disableNoCacheParameter']) {
4640 $warning .=
' However, $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set, so it will be ignored!';
4641 $GLOBALS[
'TT']->setTSlogMessage($warning, 2);
4643 $warning .=
' Caching is disabled!';
4646 GeneralUtility::sysLog($warning,
'cms', $severity);
4656 $this->no_cache = TRUE;
4667 $this->cacheTimeOutDefault = (int)$seconds;
4676 public function get_cache_timeout() {
4679 $cachedCacheLifetimeIdentifier =
'core-tslib_fe-get_cache_timeout';
4680 $cachedCacheLifetime = $runtimeCache->get($cachedCacheLifetimeIdentifier);
4681 if ($cachedCacheLifetime === FALSE) {
4682 if ($this->page[
'cache_timeout']) {
4684 $cacheTimeout = $this->page[
'cache_timeout'];
4685 } elseif ($this->cacheTimeOutDefault) {
4690 $cacheTimeout = 86400;
4692 if ($this->config[
'config'][
'cache_clearAtMidnight']) {
4693 $timeOutTime =
$GLOBALS[
'EXEC_TIME'] + $cacheTimeout;
4694 $midnightTime = mktime(0, 0, 0, date(
'm', $timeOutTime), date(
'd', $timeOutTime), date(
'Y', $timeOutTime));
4697 if ($midnightTime >
$GLOBALS[
'EXEC_TIME']) {
4698 $cacheTimeout = $midnightTime -
$GLOBALS[
'EXEC_TIME'];
4705 if (is_array($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'get_cache_timeout'])) {
4706 foreach ($this->TYPO3_CONF_VARS[
'SC_OPTIONS'][
'tslib/class.tslib_fe.php'][
'get_cache_timeout'] as $_funcRef) {
4707 $params = array(
'cacheTimeout' => $cacheTimeout);
4711 $runtimeCache->set($cachedCacheLifetimeIdentifier, $cacheTimeout);
4712 $cachedCacheLifetime = $cacheTimeout;
4714 return $cachedCacheLifetime;
4734 $urlmode = $this->config[
'config'][
'notification_email_urlmode'];
4738 $encoding = $this->config[
'config'][
'notification_email_encoding'] ?:
'';
4740 $convCharset = FALSE;
4743 if ($this->config[
'config'][
'notification_email_charset']) {
4744 $charset = $this->csConvObj->parse_charset($this->config[
'config'][
'notification_email_charset']);
4745 if ($charset != $this->renderCharset) {
4746 $convCharset = TRUE;
4748 } elseif ($this->metaCharset != $this->renderCharset) {
4751 $convCharset = TRUE;
4754 $email = $this->csConvObj->conv($email, $this->renderCharset, $charset);
4755 $subject = $this->csConvObj->conv($subject, $this->renderCharset, $charset);
4756 $message = $this->csConvObj->conv($message, $this->renderCharset, $charset);
4757 $headers = $this->csConvObj->conv($headers, $this->renderCharset, $charset);
4769 if ($desired ===
'') {
4773 $uniqueId = $desired;
4774 for ($i = 1; isset($this->usedUniqueIds[$uniqueId]); $i++) {
4775 $uniqueId = $desired .
'_' . $i;
4778 $this->usedUniqueIds[$uniqueId] = TRUE;
4794 public function sL($input) {
4795 if (substr($input, 0, 4) !==
'LLL:') {
4800 if (!isset($this->LL_labels_cache[$this->lang][$input])) {
4801 $restStr = trim(substr($input, 4));
4803 if (substr($restStr, 0, 4) ===
'EXT:') {
4804 $restStr = trim(substr($restStr, 4));
4807 $parts = explode(
':', $restStr);
4808 $parts[0] = $extPrfx . $parts[0];
4810 if (!isset($this->LL_files_cache[$parts[0]])) {
4811 $this->LL_files_cache[$parts[0]] = $this->
readLLfile($parts[0]);
4813 $this->LL_labels_cache[
$this->lang][$input] = $this->
getLLL($parts[1], $this->LL_files_cache[$parts[0]]);
4815 return $this->LL_labels_cache[
$this->lang][$input];
4826 if ($this->lang !==
'default') {
4827 $languages = array_reverse($this->languageDependencies);
4829 if (empty($languages)) {
4830 $languages[] =
'default';
4833 $languages = array(
'default');
4836 $localLanguage = array();
4837 foreach ($languages as $language) {
4838 $tempLL = GeneralUtility::readLLfile($fileRef, $language, $this->renderCharset);
4839 $localLanguage[
'default'] = $tempLL[
'default'];
4840 if (!isset($localLanguage[$this->lang])) {
4841 $localLanguage[
$this->lang] = $localLanguage[
'default'];
4843 if ($this->lang !==
'default' && isset($tempLL[$language])) {
4850 return $localLanguage;
4862 if (isset(
$LOCAL_LANG[$this->lang][$index][0][
'target'])) {
4864 } elseif (isset(
$LOCAL_LANG[
'default'][$index][0][
'target'])) {
4865 return $LOCAL_LANG[
'default'][$index][0][
'target'];
4876 public function initLLvars() {
4878 $this->languageDependencies = array();
4880 $this->lang = $this->config[
'config'][
'language'] ?:
'default';
4890 if (in_array($this->lang,
$locales->getLocales())) {
4892 foreach (
$locales->getLocaleDependencies($this->lang) as $language) {
4893 $this->languageDependencies[] = $language;
4898 $this->renderCharset = $this->csConvObj->parse_charset($this->config[
'config'][
'renderCharset'] ? $this->config[
'config'][
'renderCharset'] :
'utf-8');
4900 $this->metaCharset = $this->csConvObj->parse_charset($this->config[
'config'][
'metaCharset'] ? $this->config[
'config'][
'metaCharset'] : $this->renderCharset);
4917 $output = $this->csConvObj->conv($str, $this->csConvObj->parse_charset($from),
$this->renderCharset, 1);
4918 return $output ?: $str;
4933 if ($this->renderCharset != $this->metaCharset) {
4934 $content = $this->csConvObj->conv(
$content, $this->renderCharset, $this->metaCharset, TRUE);
4945 if ($this->renderCharset != $this->metaCharset && is_array($_POST) && count($_POST)) {
4946 $this->csConvObj->convArray($_POST, $this->metaCharset, $this->renderCharset);
4947 $GLOBALS[
'HTTP_POST_VARS'] = $_POST;
4966 foreach ($tablesToConsider as $tableDef) {
4970 return $result == PHP_INT_MAX ? PHP_INT_MAX :
$result - $now + 1;
4988 $result = array(
'tt_content:' . $this->
id);
4989 if (isset($this->config[
'config'][
'cache.'][$this->
id])) {
4992 if (isset($this->config[
'config'][
'cache.'][
'all'])) {
5010 if (empty($tableName) || empty($pid)) {
5011 throw new \InvalidArgumentException(
'Unexpected value for parameter $tableDef. Expected <tablename>:<pid>, got \'' . htmlspecialchars($tableDef) .
'\'.
', 1307190365); 5013 // Additional fields 5014 $showHidden = $tableName === 'pages
' ? $this->showHiddenPage : $this->showHiddenRecords; 5015 $enableFields = $this->sys_page->enableFields($tableName, $showHidden, array('starttime
' => TRUE, 'endtime
' => TRUE)); 5016 // For each start or end time field, get the minimum value 5017 foreach (array('starttime
', 'endtime
') as $field) { 5018 if (isset($GLOBALS['TCA
'][$tableName]['ctrl
']['enablecolumns
'][$field])) { 5019 $timeField = $GLOBALS['TCA
'][$tableName]['ctrl
']['enablecolumns
'][$field]; 5020 $selectField = 'MIN(
' . $timeField . ') AS
' . $field; 5021 $whereCondition = $timeField . ' >
' . $now; 5022 // Find the smallest timestamp which could influence the cache duration (but is larger than 0) 5023 $row = $GLOBALS['TYPO3_DB
']->exec_SELECTgetSingleRow($selectField, $tableName, 'pid =
' . (int)$pid . ' AND
' . $whereCondition . $enableFields); 5024 if ($row && !is_null($row[$field])) { 5025 $result = min($result, $row[$field]); 5038 protected function getSysDomainCache() { 5039 $entryIdentifier = 'core-database-sys_domain-complete
'; 5041 $runtimeCache = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager
')->getCache('cache_runtime
'); 5043 $sysDomainData = array(); 5044 if ($runtimeCache->has($entryIdentifier)) { 5045 $sysDomainData = $runtimeCache->get($entryIdentifier); 5047 $domainRecords = $GLOBALS['TYPO3_DB
']->exec_SELECTgetRows( 5048 'pid, domainName, forced
', 5050 'redirectTo=\
'\' ' . $this->sys_page->enableFields('sys_domain
', 0), 5055 foreach ($domainRecords as $row) { 5056 // if there is already an entry for this pid, check if we should overwrite it 5057 if (isset($sysDomainData[$row['pid
']])) { 5058 // There is already a "forced" entry, which must not be overwritten 5059 if ($sysDomainData[$row['pid
']]['forced
']) { 5063 // The current domain record is also NOT-forced, keep the old unless the new one matches the current request 5064 if (!$row['forced
'] && !$this->domainNameMatchesCurrentRequest($row['domainName
'])) { 5069 // as we passed all previous checks, we save this domain for the current pid 5070 $sysDomainData[$row['pid
']] = array( 5071 'pid
' => $row['pid
'], 5072 'domainName
' => rtrim($row['domainName
'], '/
'), 5073 'forced
' => $row['forced
'], 5076 $runtimeCache->set($entryIdentifier, $sysDomainData); 5078 return $sysDomainData; 5088 public function domainNameMatchesCurrentRequest($domainName) { 5089 $currentDomain = GeneralUtility::getIndpEnv('HTTP_HOST
'); 5090 $currentPathSegment = trim(preg_replace('|/[^/]*$|
', '', GeneralUtility::getIndpEnv('SCRIPT_NAME
'))); 5091 return $currentDomain === $domainName || $currentDomain . $currentPathSegment === $domainName; 5102 public function getDomainDataForPid($targetPid) { 5103 // Using array_key_exists() here, nice $result can be NULL 5104 // (happens, if there's no domain records defined)
5105 if (!array_key_exists($targetPid, $this->domainDataCache)) {
5107 $sysDomainData = $this->getSysDomainCache();
5108 $rootline = $this->sys_page->getRootLine($targetPid);
5111 foreach ($rootline as $pageInRootline) {
5112 $pidInRootline = $pageInRootline[
'uid'];
5113 if (isset($sysDomainData[$pidInRootline])) {
5114 $result = $sysDomainData[$pidInRootline];
5118 $this->domainDataCache[$targetPid] =
$result;
5121 return $this->domainDataCache[$targetPid];
5133 return $domainData ? $domainData[
'domainName'] : NULL;
const SHORTCUT_MODE_PARENT_PAGE
acquirePageGenerationLock(&$lockObj, $key)
createHashBase($createLockHashBase=FALSE)
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
static setSingletonInstance($className, \TYPO3\CMS\Core\SingletonInterface $instance)
static substUrlsInPlainText($message, $urlmode='76', $index_script_url='')
static isAllowedAbsPath($path)
pageNotFoundAndExit($reason='', $header='')
updateRootLinesWithTranslations()
calculatePageCacheTimeout()
getPageAndRootlineWithDomain($domainStartPage)
mergingWithGetVars($GET_VARS)
set_no_cache($reason='', $internal=FALSE)
extractRecipientCopy($bodytext)
checkPageGroupAccess($row, $groupList=NULL)
INTincScript_loadJSCode()
const SHORTCUT_MODE_FIRST_SUBPAGE
getFirstTimeValueForRecord($tableDef, $now)
const SYSLOG_SEVERITY_FATAL
static devLog($msg, $extKey, $severity=0, $dataVar=FALSE)
getLLL($index, $LOCAL_LANG)
locDataCheck($locationData)
static isFirstPartOfStr($str, $partStr)
pageUnavailableAndExit($reason='', $header='')
$ADMCMD_preview_BEUSER_uid
roundTripCryptString($string)
checkFileInclude($incFile)
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static canBeInterpretedAsInteger($var)
static getIndpEnv($getEnvName)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
checkAlternativeIdMethods()
static hmac($input, $additionalSecret='')
recursivelyReplaceIntPlaceholdersInContent()
static generatePageTitle()
getDomainNameForPid($targetPid)
clearPageCacheContent_pidList($pidList)
releasePageGenerationLock(&$lockObj)
static logDeprecatedFunction()
$loginAllowedInBranch_mode
static makeInstance($className)
static hideIfDefaultLanguage($localizationConfiguration)
generatePage_preProcessing()
$spamProtectEmailAddresses
addTempContentHttpHeaders()
determineIdIsHiddenPage()
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static verifyFilenameAgainstDenyPattern($filename)
const SYSLOG_SEVERITY_ERROR
checkPageForMountpointRedirect()
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
setPageCacheContent($content, $data, $expirationTstamp)
checkTranslatedShortcut()
static hideIfNotTranslated($l18n_cfg_fieldValue)
const SHORTCUT_MODE_RANDOM_SUBPAGE
static _GETset($inputGet, $key='')
setPageRenderer(PageRenderer $pageRenderer)
pageErrorHandler($code, $header='', $reason='')
static cmpIP($baseIP, $list)
generatePage_postProcessing()
const SYSLOG_SEVERITY_WARNING
static deprecationLog($msg)
checkIfLoginAllowedInBranch()
static checkIncludeLines_array(array $array)
findDomainRecord($recursive=FALSE)
encryptEmail($string, $back=FALSE)
includeLibraries(array $libraries)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
static compat_version($verNumberStr)
addCacheTags(array $tags)
checkPagerecordForIncludeSection($row)
pageUnavailableHandler($code, $header, $reason)
checkEnableFields($row, $bypassGroupCheck=FALSE)
static getUrl($url, $includeHeader=0, $requestHeaders=FALSE, &$report=NULL)
getCurrentPageCacheConfiguration()
static isLoaded($key, $exitOnError=FALSE)
INTincScript_process($INTiS_config)
static flushOutputBuffers()
generatePage_whichScript()
static tempnam($filePrefix, $fileSuffix='')
INTincScript_includeLibs($INTiS_config)
static removeDotsFromTS(array $ts)
convOutputCharset($content, $label='')
const SYSLOG_SEVERITY_INFO
codeString($string, $decode=FALSE)
const DOKTYPE_BE_USER_SECTION
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
logDeprecatedTyposcript($typoScriptProperty, $explanation='')
getPageAccessFailureReasons()
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
whichWorkspace($returnTitle=FALSE)
getDomainDataForPid($targetPid)
static plainMailEncoded($email, $subject, $message, $headers='', $encoding='quoted-printable', $charset='', $dontEncodeHeader=FALSE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
checkPageUnavailableHandler()
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
set_cache_timeout_default($seconds)
prefixLocalAnchorsWithScript()
pageNotFoundHandler($code, $header='', $reason='')
checkRootlineForIncludeSection()
encryptCharcode($n, $start, $end, $offset)
__construct($TYPO3_CONF_VARS, $id, $type, $no_cache='', $cHash='', $jumpurl='', $MP='', $RDCT='')
static resolveBackPath($pathStr)
$pageAccessFailureHistory
static clientInfo($useragent='')
updateMD5paramsRecord($hash)
getPageShortcut($SC, $mode, $thisUid, $itera=20, $pageLog=array(), $disableGroupCheck=FALSE)
checkPageForShortcutRedirect()
const SYSLOG_SEVERITY_NOTICE
plainMailEncoded($email, $subject, $message, $headers='')