Project

General

Profile

Actions

Bug #29325

closed

optionsplit inconsistent handling of whitespaces an zeros

Added by Tobias Hoevelborn about 13 years ago. Updated almost 10 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

Also available in: Atom PDF