Bug #27440
closedTask center - sys_action: Prefix added to username over and over again when editing BE-User
100%
Description
Since TYPO3 4.4 it is necessary to remove the prefix from a username if the BE-User is beeing edited through the task center - sys-action interface. Otherwise the prefix is added again to the already prefixed username.
In TYPO3 4.3 this problem was handled by the fixUsername method. It checked if the username began with the prefix and removed it with preg_replace before saving:
function fixUsername($username,$prefix) { $username=trim($username); $prefix=trim($prefix); $username=preg_replace('/^'.quotemeta($prefix).'/','',$username); if ($username) { return $prefix.$username; } else return false; }
Since TYPO3 4.4 the fixUsername method is simplified to this:
private function fixUsername($username, $prefix) { return trim($prefix) . trim($username); }
Is there any good reason for this oversimplification?
If not, it would make sense to me to switch back to the old TYPO3 4.3 version of this method. Maybe with a small modification to allow prefix and username to be the same:
private function fixUsername($username, $prefix) { $username=trim($username); $prefix=trim($prefix); if($username !== $prefix){ $username=preg_replace('/^'.quotemeta($prefix).'/','',$username); } if ($username) { return $prefix.$username; } else { return false; }
Updated by Tobias Schmidt about 11 years ago
This issue is still valid with TYPO3 4.5.29.
Updated by Mathias Schreiber almost 10 years ago
- Status changed from New to Closed
- Is Regression set to No
will be tackeld together with #31110
Updated by Gerrit Code Review over 9 years ago
- Status changed from Closed 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/41712
Updated by Gerrit Code Review over 9 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/41712
Updated by Gerrit Code Review over 9 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/41712
Updated by Gerrit Code Review over 9 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/41712
Updated by Daniel Goerz over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fb53445eeef15cb0c7b34702661fe9fd0cae8b83.