[TYPO3-core] RFC: #7350:PHP5ize class.t3lib_div.php

Michael Stucki michael at typo3.org
Sat Feb 2 12:25:15 CET 2008


Hi Dmitry,

> Stanislas Rolland wrote:
>> tslib_content fails:
>> 
>> Catchable fatal error: Argument 1 passed to
>> t3lib_div::implodeAttributes() must be an array, null given, called in
>> /typo3/sysext/cms/tslib/class.tslib_content.php on line 4471
> 
> t3lib_div::get_tag_attributes did not work according to documentation. Fix
> is attached. It may be sensitive, so I post here instead of
> autocommitting.
> 
> Anyway, I feel bad about mixng return value and no return value inside one
> function, which is declared as always returning value.

How about returning false instead of an empty array? Someone who is using it
now could have checked the output using is_array(), which would match now.

I don't consider this as mixing the return value, as PHP does it the same
way (see http://ch2.php.net/strstr for example).

So I'm -1 to your fix as it is now.


Additional comments.

Have a look at t3lib_div::xmlGetHeaderAttribs() - it says that it returns
string values, but the output is coming directly from get_tag_attributes().
Don't know if the phpdoc comment is wrong, at least I don't see how
get_tag_attributes() could ever return a string output. But we need to
check it thoroughly.

If you find time for it, could you also modify change all copies of this
function into wrappers for the t3lib_div function, and mark them as
deprecated? Thanks!

- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-team-core mailing list