#65123GeneralUtility::rmFromList() regression bug
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”