Project

General

Profile

Bug #18754 » effects_on_this-id_using_default_class.tslib_fe.php.txt

Administrator Admin, 2008-05-29 14:36

 

Example of what happens when a file like www.domain.com/wrong_file.pdf is called using default class.tslib_fe.php :

NB: there variables listed either side of functions show the vlaues of these variables before & after these functions.
Where the functions are indented further than the preceding function this is due to that function being called inside the previous named function.

in /typo3/sysext/cms/tslib/

$TSFE->checkAlternativeIdMethods() // called from index_ts.php # Since the 'TYPO3_SITE_SCRIPT' is not a valid typo3 SSD page. /*.html

$TSFE->determineId() // called from index_ts.php

$this->id = ''
$this->setIDfromArgV() // class.tslib_fe.php # $this->id must be 'false' in order for any processing to happen in here, BUT sinve there is no alias $this->id is set to 0
$this->id = 0

$this->id = 0
$this->fetch_the_id() // class.tslib_fe.php # Get The Page ID
$this->id = 0

$this->id = 0
$this->checkAndSetAlias() // class.tslib_fe.php # Fetches the integer page id for a page alias.
$this->id = 0
$this->pageNotFound = 0

$this->id = 0
$this->findDomainRecord() // class.tslib_fe.php # Looking up a domain record based on HTTP_HOST
$this->id = 0


since $this->id = 0 , the next code block starting with the following is executed.

if (!$this->id) { // from about line 861 in TYPO3v4.1.6

***** after the code block that follows this if statement $this->id = 1

***** this is why i suggested to replace the above if statement with this line of code, which stops the processing of $this->id when $this->id=0

***** if (!$this->id && (t3lib_div::getIndpEnv('TYPO3_SITE_SCRIPT')=='index.php' || !(t3lib_div::getIndpEnv('TYPO3_SITE_SCRIPT') && $this->TYPO3_CONF_VARS['FE']['pageNotFound_handling']))) {


$this->id = 1
$this->getPageAndRootlineWithDomain() // class.tslib_fe.php # Gets ->page and ->rootline information based on ->id. ->id may change during this operation.

$this->id = 1
$this->getPageAndRootline() // class.tslib_fe.php # Gets the page and rootline arrays based on the id, $this->id
$this->id = 1
// inside this function if $this->id still equals 0 after $this->sys_page->getPage(), and if $this->TYPO3_CONF_VARS['FE']['pageNotFound_handling'] is true then $this->pageNotFoundAndExit() is called
$this->pageNotFound = 0

$this->id = 1
$this->sys_page->getPage() // class.t3lib_page.php # If no page is found an empty array is returned.
$this->id = 1

// inside this function; if $this->id starts with a value of 0, then no page is found and an empty array is returned to function getPageAndRootline()


$TSFE->getConfigArray(); // called from index_ts.php
(4-4/7)