Project

General

Profile

Actions

Bug #29325

closed

optionsplit inconsistent handling of whitespaces an zeros

Added by Tobias Hoevelborn over 12 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2011-08-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

bug.diff (810 Bytes) bug.diff Tobias Hoevelborn, 2011-08-29 18:07
Actions #1

Updated by Andreas Wolf over 12 years ago

  • Category set to TypoScript
Actions #2

Updated by Markus Klein over 12 years ago

Sorry, can't find your patch...

Actions #3

Updated by Tobias Hoevelborn over 12 years ago

ups, sorry.

Actions #4

Updated by Jo Hasenau over 12 years ago

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.

Actions #5

Updated by Alexander Opitz over 9 years ago

  • 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)?

Actions #6

Updated by Alexander Opitz over 9 years ago

  • 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.

Actions

Also available in: Atom PDF