Commit 2e9f2b7c authored by Benni Mack's avatar Benni Mack Committed by Daniel Goerz
Browse files

[TASK] Remove option content_from_pid_allowOutsideDomain

Due to site handling the TypoScript option content_from_pid_allowOutsideDomain
is not needed anymore, and can be removed, as it does not have any effect on
the result. This was domain-specific in combination with sys_domain
and ?id=123.

Resolves: #90371
Releases: master
Change-Id: I90d6089af2461d4f605e7ff6778ccf36e008c537
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63238


Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
parent db6def12
.. include:: ../../Includes.txt
========================================================================================
Important: #90371 - TypoScript option config.content_from_pid_allowOutsideDomain removed
========================================================================================
See :issue:`90371`
Description
===========
TYPO3's Site Handling - introduced in TYPO3 v9 - allows for defining
multiple sites within one installation, whereas before all configuration was based on domain records. The TypoScript option `config.content_from_pid_allowOutsideDomain` was used to limit
the page property option "Show content from this page instead" (pages.content_from_pid) to be evaluated outside of the current page
tree which was ineffective since the usage of Site Handling.
The option serves no purpose anymore and has been removed.
.. index:: Frontend, TypoScript, ext:frontend
\ No newline at end of file
......@@ -1702,8 +1702,8 @@ class TypoScriptFrontendController implements LoggerAwareInterface
public function getPageAndRootlineWithDomain($rootPageId)
{
$this->getPageAndRootline();
// 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.
if ($rootPageId && is_array($this->rootLine) && $this->rootLine !== []) {
// Checks if the $domain-startpage is in the rootLine. This is necessary so that references to page-id's via ?id=123 from other sites are not possible.
if (is_array($this->rootLine) && $this->rootLine !== []) {
$idFound = false;
foreach ($this->rootLine as $key => $val) {
if ($val['uid'] == $rootPageId) {
......@@ -2699,6 +2699,28 @@ class TypoScriptFrontendController implements LoggerAwareInterface
$this->no_cacheBeforePageGen = $this->no_cache;
}
/**
* Check the value of "content_from_pid" of the current page record, and see if the current request
* should actually show content from another page.
*
* By using $TSFE->getPageAndRootline() on the cloned object, all rootline restrictions (extendToSubPages)
* are evaluated as well.
*
* @return int the current page ID or another one if resolved properly - usually set to $this->contentPid
*/
protected function resolveContentPid(): int
{
if (!isset($this->page['content_from_pid']) || empty($this->page['content_from_pid'])) {
return (int)$this->id;
}
// make REAL copy of TSFE object - not reference!
$temp_copy_TSFE = clone $this;
// 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!
$temp_copy_TSFE->id = $this->page['content_from_pid'];
$temp_copy_TSFE->MP = '';
$temp_copy_TSFE->getPageAndRootline();
return (int)$temp_copy_TSFE->id;
}
/**
* Sets up TypoScript "config." options and set properties in $TSFE.
*
......@@ -2707,16 +2729,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
public function preparePageContentGeneration(ServerRequestInterface $request)
{
$this->getTimeTracker()->push('Prepare page content generation');
if (isset($this->page['content_from_pid']) && $this->page['content_from_pid'] > 0) {
// make REAL copy of TSFE object - not reference!
$temp_copy_TSFE = clone $this;
// 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!
$temp_copy_TSFE->id = $this->page['content_from_pid'];
$temp_copy_TSFE->MP = '';
$temp_copy_TSFE->getPageAndRootlineWithDomain($this->config['config']['content_from_pid_allowOutsideDomain'] ? 0 : $this->site->getRootPageId());
$this->contentPid = (int)$temp_copy_TSFE->id;
unset($temp_copy_TSFE);
}
$this->contentPid = $this->resolveContentPid();
// Global vars...
$this->indexedDocTitle = $this->page['title'] ?? null;
// Base url:
......
......@@ -271,11 +271,6 @@ config.cache.all = fe_users:2]]></description>
This value is overridden by the value set in the page-record (field="cache_timeout") if this value is greater than zero.]]></description>
<default><![CDATA[86400 (=24H)]]></default>
</property>
<property name="content_from_pid_allowOutsideDomain" type="boolean">
<description><![CDATA[Using the "Show content from this page instead" feature allows you to insert content from the current domain only. Setting this option will allow content included from anywhere in the page tree!]]></description>
<default><![CDATA[
]]></default>
</property>
<property name="contentObjectExceptionHandler" type="array">
<description><![CDATA[Exceptions which occur during rendering of content objects (typically plugins) will now be caught by default in production context and an error message is shown along with the rendered output.
......
......@@ -202,7 +202,6 @@
'constants': kw('constants'),
'CONTENT': kw('CONTENT'),
'content': A,
'content_from_pid_allowOutsideDomain': kw('content_from_pid_allowOutsideDomain'),
'contextMenu': kw('contextMenu'),
'copy': A,
'copyLevels': kw('copyLevels'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment