[TYPO3-core] RFC #9779: t3lib_div::trimExplode limit parameter leads to wrong result with non-empty requirement

Benjamin Mack benni at typo3.org
Tue Mar 3 11:41:17 CET 2009


Hey Franz,

On 03.03.2009 9:14 Uhr, Franz Holzinger wrote:
> Your patch will force a complete explode in all cases.
Yes, but I think that this is the correct behaviour (or let's put it 
this way "expected behaviour" for all of the). If you want to clean 
trimmed items and you want a maximum number of items, you need this 
solution.

Imagine ",,,,anc2,sr2,,str3" and you get an empty array after removing 
trimmed items with a limit of 3.

If you have a very long string and you need that (unusual) behaviour, 
it'd make more sense to do a manual explode with a limit and an implode 
again before you let it run through the trimExplode.

Do you have a use-case for that scenario?

All the best,
Benni.


More information about the TYPO3-team-core mailing list