Bug #15203

Copy sites with flexible content elements inside crash with fatal error

Added by René Wagner over 15 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2005-11-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
5
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

bug_1869.patch (627 Bytes) bug_1869.patch Administrator Admin, 2006-01-06 11:50
patch-bug-1869-t3libdiv.txt (711 Bytes) patch-bug-1869-t3libdiv.txt Administrator Admin, 2006-01-18 23:32
#1

Updated by Sebastian Kurfuerst over 15 years ago

Hi,
you use PHP5, right?
Greets, Sebastian

#2

Updated by René Wagner over 15 years ago

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é

#3

Updated by Sebastian Kurfuerst over 15 years ago

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

#4

Updated by René Wagner over 15 years ago

Hi Sebastian,

works fine. I solved it exactly the same.

Thanks for patching.

#5

Updated by Sebastian Kurfuerst about 15 years ago

fixed in CVS.

#6

Updated by René Wagner about 15 years ago

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 &&.

#7

Updated by Sebastian Kurfuerst about 15 years ago

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

#8

Updated by Robert Lemke about 15 years ago

Looks fine, I created a new patch.

#9

Updated by Oliver Hader over 12 years ago

This issue was fixed in TYPO3 4.0.0.
Closed during Bug Day 07/2008

Also available in: Atom PDF