Project

General

Profile

Actions

Bug #65123

closed

GeneralUtility::rmFromList() regression bug

Added by Gregor Favre almost 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Backend API
Target version:
Start date:
2015-02-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:

Description

Using TYPO3 6.2.9.

GeneralUtility::rmFromList() suffers from a regression bug. It is not handling the removal of list items properly, if the list contains the item several times. The behaviour of str_replace() is documented in the PHP documentation (see http://php.net/manual/en/function.str-replace.php section "Caution: Replacement order gotcha".

The old implementation not using str_replace() but looping through the elements was working as expected.

Reproducible code:
$param1 = "A";
$param2 = "A,A,A,A,A,A,A,A";
$result = GeneralUtility::rmFromList($param1, $param2);

Expected result:
$result should be empty

Returned result:
$result is "A,A,A,A"


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #53677: GeneralUtility::rmFromList : allow to call GeneralUtility::trimExplodeClosed

Actions
Actions #1

Updated by Markus Klein almost 10 years ago

  • Category set to Backend API
  • Status changed from New to Accepted
  • Assignee set to Markus Klein
  • Priority changed from Should have to Must have
  • Target version set to next-patchlevel
Actions #2

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #3

Updated by Gerrit Code Review almost 10 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #4

Updated by Gerrit Code Review almost 10 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #5

Updated by Gerrit Code Review almost 10 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #6

Updated by Gerrit Code Review almost 10 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #7

Updated by Gerrit Code Review almost 10 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #8

Updated by Gerrit Code Review almost 10 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #9

Updated by Gerrit Code Review almost 10 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #10

Updated by Gerrit Code Review almost 10 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36967

Actions #11

Updated by Gerrit Code Review almost 10 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36990

Actions #12

Updated by Gerrit Code Review almost 10 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36990

Actions #13

Updated by Markus Klein almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Gerrit Code Review almost 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36991

Actions #15

Updated by Markus Klein almost 10 years ago

  • Status changed from Under Review to Resolved
Actions #16

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF