Bug #15035
closedImport from .t3d does not work with php5 version 5.0.5
0%
Description
I tried to use Ubuntu Badger to make a copy of an existing website exported from the normal linuxserver.
The normal server runs redhat ES3 with mysql 4.0.21 php4.4.0 and apache 1.3.33
Ubuntu uses apache 2.0.52 php5.0.5 and mysql 4.0.24.
I have exported to a debian sarge server without problems(php4.3.10).
The error message is:"Fatal error: Cannot unset string offsets in /home/infra/typo3_src-3.8.0/t3lib/class.t3lib_div.php on line 3300"
(issue imported from #M1580)
Updated by Marc Bastian Heinrichs about 19 years ago
Illegal use of string offsets causes E_ERROR instead of E_WARNING in PHP 5.
So the line 3300 in class.t3lib_div.php
unset($dataStruct['meta']) isn't compatible to PHP 5, because it's possible that there is only a String in $dataStruct.
A
if (isset($dataStruct['meta']) && is_array($dataStruct)) {
unset($dataStruct['meta']); // Meta data should not appear there.
}
solves the problem.
Updated by Martin Kutschker almost 19 years ago
Is it sufficient to test for an array?
if (is_array($dataStruct)) {
unset($dataStruct['meta']);
}
Updated by Marc Bastian Heinrichs almost 19 years ago
Hi,
I've tested again and yes, it's sufficient to test for an array.
greets
Updated by René Wagner almost 19 years ago
Because of unsetting the 'meta'-Index it is not enough to check for the whole array. An isset-Condition on the 'meta'-Key should prevent from fatal error.
if (isset($dataStruct['meta'])) unset($dataStruct['meta']);
Another issue of this can read at bugreport 1869.
Updated by Martin Kutschker over 18 years ago
In the code in CVS there is a test earlier that checks is $dataStruct is an array. As in fact it is an error to call this function with an argument that is not an array.