[TYPO3-core] RFC: fix bug #2722 and #2837
Ingmar Schlecht
ingmar at typo3.org
Wed Mar 29 09:52:31 CEST 2006
+1
cheers,
Ingmar
Franz Holzinger wrote:
> Hello Martin,
>
>> Franz Holzinger <franz at fholzinger.com> writes on
>> Mon, 20 Mar 2006 12:02:58 +0100 (MET):
>>
>>
>>
>>> This is a CVS bugfix request:
>>>
>>>
>>> http://bugs.typo3.org/view.php?id=2722
>>> http://bugs.typo3.org/view.php?id=2837
>>>
>>> The table wizard gives error messages under PHP 5.1.2 because of not
>>> defined arrays when it tries to access its elements.
>>>
>>> I have observed from the code that $this->tableParsing_delimiter has
>>> not be initialized. This would be missing if the record has not been
>>> stored yet.
>>>
>>>
>>
>> You added the initializing
>> $this->tableParsing_delimiter = '|';
>> but no
>> $this->tableParsing_quote = '';
>>
>>
> ok
>
>> I think this is longer than necessary:
>>
>> if (is_array($flexForm) && is_array($flexForm['data']) && is_array($flexForm['data']['s_parsing']) && is_array($flexForm['data']['s_parsing']['lDEF']))
>>
>> After saving $flexForm is an array. So IMHO this code is sufficient:
>>
>> if (is_array($flexForm) {
>> $this->tableParsing_quote = $flexForm['data']['s_parsing']['lDEF']['tableparsing_quote']['vDEF']?chr(intval($flexForm['data']['s_parsing']['lDEF']['tableparsing_quote']['vDEF'])):'';
>> $this->tableParsing_delimiter = $flexForm['data']['s_parsing']['lDEF']['tableparsing_delimiter']['vDEF']?chr(intval($flexForm['data']['s_parsing']['lDEF']['tableparsing_delimiter']['vDEF'])):'|';
>> }
>>
>>
>>
> ok
>
>> I still haven't changed to PHP5 in production yet. Is there really no way to test a nested array? Like is_XXX($foo['a']['b']['c'])
>>
>> Those multiple tests are horrible. They are not readable and are a waste of CPU cycles.
>>
>>
> Yes, it would be fine to have the PHP4 behaviour also with PHP5 where no
> check of an array would be necessary at all. It should just return NULL
> and not create any error message. However if it goes to PHP5 then a
> try-catch clause can be written.
>
> Regards,
>
> Franz
More information about the TYPO3-team-core
mailing list