Project

General

Profile

Actions

Bug #16754

closed

split returnKey fails to recognize the max property

Added by Carlos A over 17 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2006-11-30
Due date:
% Done:

0%

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

Description

stdWrap "split" function has a "max" property, that don't work when "returnKey" is used.

If, using typoscript, we want to get the last part of a split, for example using max = 1, thus getting just two parts, we don't get the last part of the split. Instead, the content being split will be exploded without limit, and we will get just the second item of the whole array.

This is implemented at class.tslib_content.php line 4021:

$valArr=explode($conf['token'],$value);

If this behavior was not done on purpose, maybe the script should find out if returnKey and max are being used together and, if so, explode the $value, using the third argument of the explode function, so it can return the whole last part of the split.

(issue imported from #M4594)

Actions #1

Updated by Carlos A over 17 years ago

I added a new line to the script, between lines 4024 and 4025, and now they are like this:

$key = intval($this->stdWrap($conf['returnKey'],$conf['
if($conf['max']) $valArr=explode($conf['token'],$value,$conf['max']+1); // NEW LINE
$content = isset($valArr[$key]) ? $valArr[$key] : '';

This worked so far.

Actions #2

Updated by Alexander Opitz about 11 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)
  • TYPO3 Version changed from 4.1beta1 to 4.1
  • PHP Version deleted (4)

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #3

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Actions

Also available in: Atom PDF