Project

General

Profile

Actions

Bug #15035

closed

Import from .t3d does not work with php5 version 5.0.5

Added by Allan Jacobsen over 18 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2005-10-12
Due date:
% Done:

0%

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

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)

Actions #1

Updated by Marc Bastian Heinrichs over 18 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.

Actions #2

Updated by Martin Kutschker over 18 years ago

Is it sufficient to test for an array?

if (is_array($dataStruct)) {
unset($dataStruct['meta']);
}

Actions #3

Updated by Marc Bastian Heinrichs over 18 years ago

Hi,
I've tested again and yes, it's sufficient to test for an array.

greets

Actions #4

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

Actions #5

Updated by Martin Kutschker about 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.

Actions

Also available in: Atom PDF