[TYPO3-core] Bug 3552: Uninitialized array causes problems in PHP5

Dmitry Dulepov typo3 at accio.lv
Thu Jul 20 09:52:09 CEST 2006


Hi!

I like Ingmar's version more but it is a bit complex for understanding. 
I would love if is_array checks go outside of a function call. However I 
  do not see elegant way to do it, so I vote for Ingmar's version.

I afraid this is not the last place where problem happens. I already 
start thinking about creating schema for our xmls to prevent such problems.

Dmitry.

Ingmar Schlecht wrote:
> Hi Bernhard,
> 
> Bernhard Kraft wrote:
>> This is a CVS patch request
>> (my first since SVN - could anyone point me to a thread where it has been
>> discussed how to commit now (i know svn update/commit - just not if we have to
>> use special branches or whatever)
>>
>> Bugtracker reference:
>> http://bugs.typo3.org/view.php?id=3552
> 
> Adding another is_array() to the if clause would completely skip the
> code in between the if clause. Is that intended? I don't exactly know
> what the function is, but I don't quite think it's right to completely
> stop the recursive call of checkValue_flex_procInData_travDS() in case
> $dataValues_current[...] is not an array.
> 
> I have attached a different patch, but didn't test it at all (haven't
> got TV installed).
> 
> BTW, do you know if this is related to
> http://bugs.typo3.org/view.php?id=3840? Someone on the dev-list said
> that one is still not fixed either.
> 
> cheers
> Ingmar
> 
> 
> ------------------------------------------------------------------------
> 
> Index: C:/apache/typo3/typo3_src-4.0/t3lib/class.t3lib_tcemain.php
> ===================================================================
> --- C:/apache/typo3/typo3_src-4.0/t3lib/class.t3lib_tcemain.php	(revision 1642)
> +++ C:/apache/typo3/typo3_src-4.0/t3lib/class.t3lib_tcemain.php	(working copy)
> @@ -1958,7 +1958,13 @@
>  								if (is_array($dataValues[$key]['el'][$ik][$theKey]['el']))	{
>  									$this->checkValue_flex_procInData_travDS(
>  											$dataValues[$key]['el'][$ik][$theKey]['el'],
> -											$dataValues_current[$key]['el'][$ik][$theKey]['el'],
> +											(
> +												is_array($dataValues_current[$key]['el'][$ik]) &&
> +												is_array($dataValues_current[$key]['el'][$ik][$theKey]) &&
> +												is_array($dataValues_current[$key]['el'][$ik][$theKey]['el']) ?
> +												$dataValues_current[$key]['el'][$ik][$theKey]['el']:
> +												array()
> +											),
>  											$uploadedFiles[$key]['el'][$ik][$theKey]['el'],
>  											$DSelements[$key]['el'][$theKey]['el'],
>  											$pParams,


-- 
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)



More information about the TYPO3-team-core mailing list