Bug #16851
closederrors from getStorageSiterootPids() in class.tslib_fe.php with userdef. RealURL conf., because of unitialized $this->rootLine
0%
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)
Files
Updated by Tania over 16 years ago
I have found the same problem, and couldn't be able to find the reason why the rootline is not initialized, anyway it should be check in the source code that the array is not initialized, i have made a patch for 4.0.4 and 4.16 cause it tested in all the versions after 4.0.4 until 4.1.6. Hope the patch is taken in consideration.