71032[BUGFIX] Pad multibyte strings correctly
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Wouter Wolters +1
- Benni Mack +1
-
Verified V +2 Done
- Georg Ringer +2
- Wouter Wolters +1
- Benni Mack +1
- core-ci +1 CI
Issues 2
Files 5
- typo3/sysext/core/Classes/Utility/StringUtility.php+43 −0
- typo3/sysext/core/Tests/Unit/Utility/StringUtilityTest.php+79 −0
- typo3/sysext/fluid/Classes/ViewHelpers/Format/PaddingViewHelper.php+2 −1
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php+1 −1
- typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php+16 −0
Review log 1520
-
Sybille Peters uploaded patch set 1 09/11/21, 16:02
-
Sybille Peters uploaded patch set 2 09/11/21, 16:12
-
core-ci voted on patch set 1 V +1 09/11/21, 16:16 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16571
-
core-ci voted on patch set 2 V +1 09/11/21, 16:27 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16573
-
Sybille Peters uploaded patch set 3 09/11/21, 16:54
-
core-ci voted on patch set 3 V +1 09/11/21, 17:10 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16576
-
Sybille Peters uploaded patch set 4 09/11/21, 17:53
-
Sybille Peters uploaded patch set 5 09/11/21, 17:59
-
core-ci voted on patch set 4 V +1 09/11/21, 18:08 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16580
-
core-ci voted on patch set 5 V +1 09/11/21, 18:17 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16581
-
Georg Ringer commented on patch set 5 09/11/21, 20:50
If you didn't come up with this yourself but took it from somewhere else, please add the author -
Sybille Peters commented on patch set 5 09/12/21, 13:23
Reply
I wrote it myself. The solutions I looked at took a slightly different approach. These are some solutions: - original str_pad (in C): https://github.com/php/php-src/blob/master/ext/standard/string.c - php.net comments, e.g. https://www.php.net/manual/en/function.str-pad.php#116244 - stackoverflow: https://stackoverflow.com/a/14773638/2444812 -
Sybille Peters commented on patch set 5 09/12/21, 13:33
Reply
I could say "inspired by" the solution on Stack Overflow which kind of gave me the idea that PHP does not come with a multibyte solution for str_pad() and you have to write one yourself. But the implementation is quite different (and the comments suggest the solution on Stack Overflow might not work correctly). -
Benni Mack voted on patch set 5 V +1 CR +1 09/17/21, 09:08
-
Wouter Wolters voted on patch set 5 V +1 CR +1 09/22/21, 17:27
-
Georg Ringer voted on patch set 5 V +2 CR +2 09/22/21, 17:42
-
Georg Ringer merged patch set 6 09/22/21, 17:42
-
Simon Schaufelberger commented on patch set 6 09/22/21, 19:14
can/will this be backported to v10 as well? -
Simon Schaufelberger commented on patch set 6 09/23/21, 13:11
Reply
this would probably fix my padding issue in my plain text emails 🎉 -
Simon Schaufelberger commented on patch set 6 12/10/24, 17:11
Reply
Done