Bug #15203
closed
Copy sites with flexible content elements inside crash with fatal error
Added by René Wagner about 19 years ago.
Updated over 16 years ago.
Description
Line 3319 of /t3lib/class.t3lib_div.php (Rev. 1.84) unsets an array-offset that not necessarily exists, this forces an fatal error that should be prevented with an isset-Condition.
(issue imported from #M1869)
Files
Hi,
you use PHP5, right?
Greets, Sebastian
Hi Sebastian,
yes its right. PHP 5.0.4. But i didn't find any diffenenz between the versions by unsetting nonexistent variables. Even if, testing before is not as bad. :)
Thanks.
René
Hi,
can you please check if the attached patch fixes your issue? I still use PHP 4 so I cannot test right now.
Greets, Sebastian
Hi Sebastian,
works fine. I solved it exactly the same.
Thanks for patching.
I found a bug in PHP that our solution infiltrates. If $dataStruct is a string and not an array, isset() on a nonexistent key returns always true. This is also reported in manual http://de3.php.net/manual/de/function.isset.php. So a check for type array is needed first.
if (is_array($dataStruct) && isset($dataStruct['meta'])) unset($dataStruct['meta']);
should fix this bug. If $dataStruct isn't an array, the isset-Check can be void, so i have choose &&.
Hi Robert,
I hope you are alright! If you could have a look at this issue (the last note), this would be of great help.
Thanks,
and greets from Dresden,
Sebastian
Looks fine, I created a new patch.
This issue was fixed in TYPO3 4.0.0.
Closed during Bug Day 07/2008
Also available in: Atom
PDF