Project

General

Profile

Actions

Bug #15203

closed

Copy sites with flexible content elements inside crash with fatal error

Added by René Wagner over 18 years ago. Updated over 15 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
Actions #1

Updated by Sebastian Kurfuerst over 18 years ago

Hi,
you use PHP5, right?
Greets, Sebastian

Actions #2

Updated by René Wagner over 18 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é

Actions #3

Updated by Sebastian Kurfuerst over 18 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

Actions #4

Updated by René Wagner over 18 years ago

Hi Sebastian,

works fine. I solved it exactly the same.

Thanks for patching.

Actions #5

Updated by Sebastian Kurfuerst about 18 years ago

fixed in CVS.

Actions #6

Updated by René Wagner about 18 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 &&.

Actions #7

Updated by Sebastian Kurfuerst about 18 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

Actions #8

Updated by Robert Lemke about 18 years ago

Looks fine, I created a new patch.

Actions #9

Updated by Oliver Hader over 15 years ago

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

Actions

Also available in: Atom PDF