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

Franz Holzinger franz at fholzinger.com
Wed Jul 19 23:17:11 CEST 2006

Hello Ingmar,

>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:
>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).

I think Berhard's patch is fine because a check of an empty value would 
not make sense. This would lead into the function checkValue_SW:

function checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$uploadedFiles,$tscPID)	{

	$PP = array($table,$id,$curValue,$status,$realPid,$recFID,$tscPID);

	switch ($tcaFieldConf['type']) {
		case 'text':
		case 'passthrough':
		case 'user':
			$res['value'] = $value;
		case 'input':
			$res = $this->checkValue_input($res,$value,$tcaFieldConf,$PP,$field);
		case 'check':
			$res = $this->checkValue_check($res,$value,$tcaFieldConf,$PP);
		case 'radio':
			$res = $this->checkValue_radio($res,$value,$tcaFieldConf,$PP);
		case 'group':
		case 'select':
			$res = $this->checkValue_group_select($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$field);
		case 'flex':
			if ($field)	{	// FlexForms are only allowed for real fields.
				$res = $this->checkValue_flex($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$field);
			#debug(array($tcaFieldConf,$res,$value),'NON existing field type:');

	return $res;

Or it would lead into a
Call back function, default is checkValue_SW().
I think a check makes only sense when there exists a current value. Or 
what should be checked otherwise by the checkValue_* functions ?

- Franz

More information about the TYPO3-team-core mailing list