Issue Bug Closed

#16851errors from getStorageSiterootPids() in class.tslib_fe.php with userdef. RealURL conf., because of unitialized $this->rootLine

Joscha Feth 01/10/07, 23:55 updated 08/06/10, 13:20

Description

I get the following errors:
—————————— 8< ——————————-
Warning: reset() [function.reset]: Passed variable is not an array or object in /path/to/typo3_src-4.0.4/typo3/sysext/cms/tslib/class.tslib_fe.php on line 3708

Warning: Variable passed to each() is not an array or object in /path/to/typo3_src-4.0.4/typo3/sysext/cms/tslib/class.tslib_fe.php on line 3709

Warning: reset() [function.reset]: Passed variable is not an array or object in /path/to/typo3_src-4.0.4/typo3/sysext/cms/tslib/class.tslib_fe.php on line 3708

Warning: Variable passed to each() is not an array or object in /path/to/typo3_src-4.0.4/typo3/sysext/cms/tslib/class.tslib_fe.php on line 3709
—————————— 8< ——————————-

from getStorageSiterootPids() in class.tslib_fe.php.
It seems, as if $this->rootLine is accessed before initialization. This leads to errors from reset($this->rootLine) and each($this->rootLine) in line 3708 and 3709 of cms/tslib/class.tslib_fe.php.

I can only presume it is because of my realurl configuration (attached), but I can’t find an error in there. And even if there is an error, the function should check for is_array($this->rootLine) before doing reset() and each() on it.

Patch would be adding:

if(!is_array($this->rootLine)) {
return array();
}

to the function.
(issue imported from #M4768)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.