Issue Bug Closed

#29325optionsplit inconsistent handling of whitespaces an zeros

Tobias Hoevelborn 08/29/11, 17:29 updated 01/23/15, 13:13

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

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.