Bug #29325
closed
optionsplit inconsistent handling of whitespaces an zeros
Added by Tobias Hoevelborn about 13 years ago.
Updated almost 10 years ago.
Description
optionsplit as implemented in splitConfArray($conf, $splitCount) in class.t3lib_tstemplate.php uses a simple explode by |*| and a subsequent if($main0) etc. for the determination of the main parts, leading to the following behaviour:
1|*| |*|2 => middle part present (space)
1|*|0|*|2 => middle part empty (if(0))
1|*| 0|*|2 => middle part present (if(' 0'))
Whe splitting subparts an explode by || followed by a count and a trim during assignment leads to a more expectable but rather different behaviour:
1||0|*||*| => last subpart of first main part is not empty but the string '0' will be assigned.
I attached a small patch that would change the checking of main parts to strlen(trim()), to achive a hopefully less confusing behaviour.
Do I overlook something?
thanks and kind regards, Tobias
Files
- Category set to TypoScript
Sorry, can't find your patch...
Actually the bug is in the TS used for testing.
TSref gives an example for the correct syntax:
first1 || first2 |*| middle1 || middle2 || middle3 |*| last1 || last 2
Now it seems that the space is not optional but necessary to make it work.
On the other hand it doesn't hurt, if we adjust the bevaiour if it doesn't introduce a breaking change.
- Status changed from New to Needs Feedback
- Is Regression set to No
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.5)?
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Also available in: Atom
PDF